[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 22:18:18 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 SirLouen):
Replying to [comment:29 pbiron]:
> Whether `Safe SVG` wants to add a callback for the `mime_type` filter or
not is up to them, but I don't think it really matters for 2 reasons
>
> 1. SVGs don't need sub-sizes generated
> 2. the upload should be allowed by the REST API even if Imagick isn't
installed (i.e., GD is used for editing images)
Good catch. By adding
`'svg' => 'image/svg+xml'`
to the `wp_get_mime_types` function, problem gets solved with Imagick
But as you said, SVG shouldn't really need resized individual files, nor
Imagick should be a requirement for this purpose. Hence, I think that the
solution of just using a referenced variable does the trick pretty well
without the need of adding more hassle to the users with extra hooks.
Replying to [comment:28 adamsilverstein]:
> Interesting, does it actually resize them?
You can't resize them in the file editor. Probably for the same reason
above. Everything is empty, the image, the sizings, etc...
> right, this should return true for your system, might be worth digging
in a bit to see whats happening there.
I was testing with the default docker container from
[https://github.com/wordpress/wordpress-develop/ wordpress-develop] (for
imagick support, setting PHP version to 8.2)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63302#comment:30>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list