[wp-trac] [WordPress Trac] #63302: SVG images can't be uploaded anymore due to a resizing issue
WordPress Trac
noreply at wordpress.org
Sat Apr 19 15:12:17 UTC 2025
#63302: SVG images can't be uploaded anymore due to a resizing issue
-------------------------------------------------+-------------------------
Reporter: audrasjb | Owner:
| adamsilverstein
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 6.8.1
Component: Editor | Version: 6.8
Severity: normal | Resolution:
Keywords: has-screenshots has-patch dev- | Focuses:
feedback needs-testing has-testing-info |
needs-unit-tests |
-------------------------------------------------+-------------------------
Comment (by adamsilverstein):
> After investigating changeset 60084, I found that two different
implementations exist for handling unsupported image formats:|
Indeed, [https://github.com/WordPress/wordpress-develop/pull/7629/files
initially] we handled only specific types, eventually we decided to
include all supported types with the 'image/' prefix when running the
handling check.
> The problem is that SVG images don't need to have "responsive images
generated".
This seems like the critical point: while having a mime type with an
"image" prefix, SVG images are in fact "Scalable Vector Graphics" that can
be scaled directly - unlike any other image type as far as I can tell.
For that reason I would prefer hard coding an exception for SVG's from the
upload check, along with an inline comment to explain ''why'', as well as
a test validating the behavior.
> I've come with the idea of adding a global constant for this purpose
This feels like too much, image formats change very rarely and I don't see
us adding additional scalable formats in the future (are there any?). SVGs
don't need resizing and should be included in this check. Is there a use
case for being able to change that behavior?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63302#comment:24>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list