Opened 10 years ago
Last modified 6 years ago
#31258 reopened defect (bug)
SVG replaced by default image in media library
Reported by: | Automatic-rock | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.1 |
Component: | Media | Keywords: | needs-patch |
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 (3)
Change History (18)
#2
@
10 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)
#4
@
10 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
@
10 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.
#6
@
10 years ago
I submitted a PR for this: https://github.com/WordPress/WordPress/pull/132
#7
@
10 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.
#8
@
10 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?
@
10 years ago
Patch to fix gallery in grid mode as well as normal view, and to add upload support to core WP
#10
@
10 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
@
10 years ago
Fixes Media Grid and Enables uploads viewable in media area of WordPress without enabling SVG support for uploads...
#11
@
10 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
@
10 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
@
10 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.
Confirmed. SVG is displayed correctly in list view, but not in grid view.