GNOME Bugzilla – Bug 739682
doesn't recognize mime type image/jpg
Last modified: 2015-04-06 12:06:17 UTC
Had this problem at at Wikipedia. I'm assuming the issue is yours rather than theirs. When librsvg rasterizes an SVG with an embedded JPG, if the mime type of that embedded image is "image/jpg" the embedded image simply doesn't render. If however the mime type is "image/jpeg", everything works fine. Below are two examples. The first is normal. The second is broken. https://commons.wikimedia.org/wiki/File:Missing_embedded_JPG_example_1.svg https://commons.wikimedia.org/wiki/File:Missing_embedded_JPG_example_2.svg
Thought I'd mention (apologies if this is common knowledge) that MediaWiki uses the librsvg library to rasterize SVG images into PNGs.
This is because Windows registry do not contain image/jpg See HKCR\MIME\Database\ContentType There are many problem caused by this especially when called by g_content_type_from_mime_type() I also have several bugreports because of that too. I think the function need some kind of fallback on Windows...
Or could be because gdk-pixbuf doesn't register image/jpg (just image/jpeg) mime but that would affect linux too. I don't see g_content_type_from_mime_type in rsvg though, sorry.
Well, the mime type for jpeg is image/jpeg. Wikipedia should use the correct mime types.
https://en.wikipedia.org/wiki/Wikipedia:SVG_help#Missing_embedded_JPG_images 'Older versions of Inkscape (and possibly others) assigned the MIME type "image/jpg".'
BTW I can confirm adding image/jpg in gdk-pixbuf/io-jpeg.c and gdk-pixbuf/io-gdip-jpeg will solve the problem. Under windows, IE also have bizarre alias called image/pjpeg for progressive jpeg. Though I doubt it widely recognized.
BTW I can confirm that adding "image/jpg" in gdk-pixbuf/io-jpeg.c and gdk-pixbuf/io-gdip-jpeg will solve the problem. Under windows, IE also have bizarre alias called image/pjpeg for progressive jpeg. Though I doubt it widely recognized.
I consider this a wikipedia issue. They are serving invalid svg files...