Re: [Django] #14092: ImageField should allow SVG

181 views
Skip to first unread message

Django

unread,
Dec 16, 2012, 10:23:37 AM12/16/12
to django-...@googlegroups.com
#14092: ImageField should allow SVG
-------------------------------------+-------------------------------------
Reporter: graeme | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: 1.2
(models, ORM) | Resolution: wontfix
Severity: Normal | Triage Stage:
Keywords: | Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* 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.

Django

unread,
Mar 11, 2016, 7:02:15 AM3/11/16
to django-...@googlegroups.com
#14092: ImageField should allow SVG
-------------------------------------+-------------------------------------
Reporter: graeme | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: 1.2
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:

| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
May 18, 2022, 8:27:05 AM5/18/22
to django-...@googlegroups.com
#14092: ImageField should allow SVG
-------------------------------------+-------------------------------------
Reporter: graeme | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: 1.2
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
May 18, 2022, 8:40:59 AM5/18/22
to django-...@googlegroups.com
#14092: ImageField should allow SVG
-------------------------------------+-------------------------------------
Reporter: graeme | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: 1.2
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
May 20, 2022, 11:25:37 AM5/20/22
to django-...@googlegroups.com
#14092: ImageField should allow SVG
-------------------------------------+-------------------------------------
Reporter: graeme | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: 1.2
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
May 22, 2022, 4:24:31 AM5/22/22
to django-...@googlegroups.com
#14092: ImageField should allow SVG
-------------------------------------+-------------------------------------
Reporter: graeme | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: 1.2
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Jul 30, 2025, 5:18:09 PMJul 30
to django-...@googlegroups.com
#14092: ImageField should allow SVG
-------------------------------------+-------------------------------------
Reporter: graeme | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: 1.2
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by 0lini):

For anyone interested, there is this issue, regarding svg support in
pillow

https://github.com/python-pillow/Pillow/issues/3509
--
Ticket URL: <https://code.djangoproject.com/ticket/14092#comment:11>
Reply all
Reply to author
Forward
0 new messages