[wp-trac] [WordPress Trac] #56863: Issue on media page

WordPress Trac noreply at wordpress.org
Thu Oct 20 10:22:14 UTC 2022


#56863: Issue on media page
-----------------------------+--------------------------------------
 Reporter:  sumitsingh       |       Owner:  (none)
     Type:  defect (bug)     |      Status:  reopened
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  General          |     Version:  6.0.3
 Severity:  normal           |  Resolution:
 Keywords:  has-screenshots  |     Focuses:  ui, css, administration
-----------------------------+--------------------------------------

Comment (by costdev):

 > @kebbet wp_getimagesize uses native PHP getimagesize and that does not
 support SVG's. Thats why 1px I guess.

 Nice catch!

 Getting the right size for SVGs may involve parsing XML and for
 proportional SVGs, this could get messy quite quickly. Fixing the display
 via CSS is only part of the issue, as the image `width` and `height`
 attributes would need to be fixed too.

 After reading about it previously working in WordPress < 4.0, I checked
 WordPress 3.9, and got the same result: `width="1" height="1"`.

 Since they didn't work in 3.9, and SVG uploads aren't natively supported
 by Core, I don't think we should be add code to ''partially'' facilitate
 them. Extenders have already found a way to make this work. It's not a fix
 in Core, but rather part of what's required to provide SVG support.

 IMO, ''if'' we were going to support SVG uploads in Core at all, I'd
 prefer to go all-in and support them entirely.

 > @kebbet Duplicate of #24251 ?

 For the above reasons, I agree that it's appropriate to consider this at
 least a partial duplicate of the above ticket and to continue discussion
 there.

 @sumitsingh Do you agree?

 P.S. After searching "svg" on the `Plugins > Add New` screen, I installed
 the first plugin result and it had the CSS fix already in the plugin. 😉

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


More information about the wp-trac mailing list