* status: new => closed
* resolution: => wontfix
Comment:
`ImageField` is raster-oriented:
- it validates common raster formats (JPG and PNG);
- it denormalizes image width and height.
There's little in common between raster and vector handling — at least in
the scope of PIL. And SVGs don't have a width and a height expressed in
pixel in general. I don't see what ImageField adds to FileField when it
comes to SVG files.
--
Ticket URL: <https://code.djangoproject.com/ticket/14092#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by ambivalentno):
As svg is required more and more often (and sometimes quite unexpectedly),
I've made a quick workaround (in django-rest-framework context) to have
PIL-based image validation and minimal svg detection for the same
FormField:
https://7webpages.com/blog/how-to-have-svg-allowed-as-an-image-for-django-
rest-framework/
--
Ticket URL: <https://code.djangoproject.com/ticket/14092#comment:6>
Comment (by Michael):
Could this be revisited, as SVG is an essential image format for the web.
--
Ticket URL: <https://code.djangoproject.com/ticket/14092#comment:7>
Comment (by Carlton Gibson):
Hi Michael.
It's marked Someday/Maybe — so, after all this time, an outline (or proof-
of-concept) of how it's addressable would be enough to move it on.
* Did PIL/Pillow gain SVG support?
* Is there another (secure) way forward?
--
Ticket URL: <https://code.djangoproject.com/ticket/14092#comment:8>
Comment (by Graeme Pietersz):
To do it securely we would probably need to add a dependency - there are
libraries that can do this (e.g. scour) but I do not know which one would
be best.
It could be an optional dependency (as PIL/Pillow already is).
--
Ticket URL: <https://code.djangoproject.com/ticket/14092#comment:9>
Comment (by Claude Paroz):
Is there any third-party package that implements that currently, and could
maybe be considered as a candidate for core integration?
--
Ticket URL: <https://code.djangoproject.com/ticket/14092#comment:10>