Make WordPress Core

Opened 11 years ago

Closed 5 weeks ago

#31258 closed defect (bug) (worksforme)

SVG replaced by default image in media library

Reported by: automatic-rock's profile Automatic-rock Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.1
Component: Media Keywords:
Focuses: ui, administration Cc:

Description

I have enabled svg support for the media library.
In Wordpress 3.9 I could nicely upload an svg file and it would show a thumbnail of the svg image in the media library.
Now I've updated to Wordpress 4.1 and now all the svg files are replaced with a default image and a text stating the title of the svg file.

Although, everything still works (I can still add the svg file and so on), it was very handy to see what the svg file looked like. Is there are reason why this is changed?
Is there something I can do to change it back?

By the way, I've tried this in a fresh new Wordpress install without any other plugins and using a default theme.

Attachments (4)

allow_svg_thumbs_in_media_manager.diff (676 bytes) - added by silb3r 11 years ago.
Allow SVG thumbnails in the Media Manager
wordpress-svg.patch (2.1 KB) - added by LewisCowles 11 years ago.
Patch to fix gallery in grid mode as well as normal view, and to add upload support to core WP
media-template-grid-fix.patch (1.7 KB) - added by LewisCowles 11 years ago.
Fixes Media Grid and Enables uploads viewable in media area of WordPress without enabling SVG support for uploads…
two-svg-images-grid-mode.png (48.3 KB) - added by sabernhardt 5 weeks ago.
Two SVG images shown in Grid mode with WordPress 6.9 (one image without dimensions, one with them)

Download all attachments as: .zip

Change History (20)

#1 @SergeyBiryukov
11 years ago

  • Focuses accessibility removed

Confirmed. SVG is displayed correctly in list view, but not in grid view.

Version 0, edited 11 years ago by SergeyBiryukov (next)

#2 @Automatic-rock
11 years ago

Maybe unnecessary to mention, but it's the same problem in the media manager (when you want to add an image to a post or page)

#3 @ocean90
11 years ago

As mentioned in the support forums, this is a side effect of #29245 and [29528].

#4 @Automatic-rock
11 years ago

Thanks ocean90,

So the problem is media grid won't display images that don't have data.sizes set.
Maybe an exception should be made for svg, since it can be scaled to any size?

#5 @Kelderic
11 years ago

+1 for the exception for SVG. The format is widely used and will only continue to grow due to it's flexibility on display densities.

#7 @tsquez
11 years ago

@silb3r - the WordPress repository clearly states the following:

Please do not send pull requests. Submit patches to http://core.trac.wordpress.org/ instead.

@silb3r
11 years ago

Allow SVG thumbnails in the Media Manager

#8 @sterlo
11 years ago

This would be nice as it saves me work :)

https://github.com/grok/wordpress-plugin-scalable-vector-graphics/issues/5

which is for: https://wordpress.org/plugins/scalable-vector-graphics-svg/

Tangent: have SVG files become supported in core yet?

Last edited 11 years ago by sterlo (previous) (diff)

#9 @SergeyBiryukov
11 years ago

#31973 was marked as a duplicate.

@LewisCowles
11 years ago

Patch to fix gallery in grid mode as well as normal view, and to add upload support to core WP

#10 @LewisCowles
11 years ago

Check out the patch I submitted to add SVG to core in media upload, grid, regular view etc. It's slightly different to your patch, but it works in IE(edge), FF(edge) & chrome(edge) with no bugs I could see. Also tested on apache php5.4 and nginx php5.5 FPM

@LewisCowles
11 years ago

Fixes Media Grid and Enables uploads viewable in media area of WordPress without enabling SVG support for uploads...

#11 @LewisCowles
11 years ago

Apparently #24251 deals with adding SVG to the core, so in the interests of adding media support in the media area without augmenting upload, as with the original, but with Grid support, submitted a new patch that does not modify the uploader...

#12 @chriscct7
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Per #24251 WordPress will continue not allowing SVG uploads by default. Therefore, adjusting WordPress to support SVGs internally remains in plugin territory, and as such, closing as invalid.

#13 @Kelderic
11 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

Before we close this, could we get some stats from WP.com about how many users have any SVG images uploaded on their sites? From browsing the web I see SVG images all over, but I have no hard data on the actual usage. According to http://w3techs.com, the usages across the entire web is at under 1%, but augmenting this with some WP specific numbers would be helpful.

#14 @helen
11 years ago

  • Milestone set to Awaiting Review

I seriously doubt .com allows SVG uploads. I tried it on my .com site, and it was rejected due to file type.

I think it's fine to leave this open, we should probably make sure list and grid views behave the same way.

#15 @johnbillion
11 years ago

  • Keywords needs-patch added

@sabernhardt
5 weeks ago

Two SVG images shown in Grid mode with WordPress 6.9 (one image without dimensions, one with them)

#16 @sabernhardt
5 weeks ago

  • Keywords needs-patch removed
  • Resolution set to worksforme
  • Status changed from reopened to closed

Image previews have been added for SVG in Grid mode at some point.

Note: See TracTickets for help on using tickets.