[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:22:59 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):

 > > 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?

 Yes I was exactly
 [https://core.trac.wordpress.org/ticket/63302?replyto=24#comment:18
 thinking this here], but with all the futureproofing thing, I came down to
 this alternative

 Although I think that its not wrong to set some sort of const or even a
 variable array to set descriptively this particular scenario.

 The problem is that the check is picking supported formats from GD, and
 obv, SVG is not included, resulting in a failure. So, anything like
 "NON_RESIZABLE_FORMATS" (maybe not global, but at least local or at
 minimum a descriptive array variable, will help debug and come through in
 the future (agreeing with @pbiron) _just in case_ there is an unlikely new
 format in the future (instead of just hard-coding the format as I
 suggested previously)

 Simply with this, I think this could be done. Which option do you like the
 most?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63302#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list