Page 1 of 1

SVG including an image without file extension

Posted: 2014-09-10T01:29:44-07:00
by Robar
Hi!

I currently converting a SVG to PNG, which works pretty well.

Due a technical limitation in the backend of my companies software, all images will be saved without a file extensions (stone instead of stone.png), just the MIME types is set.

The SVG which will now be generated may look something like this (simplified):

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" version="1.1" viewBox="0 0 619 345" width="619" height="345">
	<image width="300" height="232" opacity="1" xlink:href="https://devpublic.blob.core.windows.net/companies/INDIVALUE/resources/02449SLRKtc" />
	<rect width="100" height="50" style="fill:rgb(0,0,255);" />
</svg>
The problem now is that Magick.NET or ImageMagick (I don't know which one is the culprit :D -> maybe this topic needs to be moved) won't rasterize the image in the SVG, because it has no extension (only the blue rectangle is in the final png). I guess Magick.NET or ImageMagick gets the image type from the file extension and needs it to rasterize the image?!?

If I add a file with a extension, everything works like a charm.

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" version="1.1" viewBox="0 0 619 345" width="619" height="345">
	<image width="300" height="232" opacity="1" xlink:href="https://devpublic.blob.core.windows.net/companies/INDIVALUE/resources/02449SLRKtc.png" />
	<rect width="100" height="50" style="fill:rgb(0,0,255);" />
</svg>
My question: Is there a solution/setting to allow images in SVG without file extension?

Re: SVG including an image without file extension

Posted: 2014-09-10T02:29:43-07:00
by dlemstra
This looks like an issue in the library that reads the SVG file (librsvg). I will investigate this for you.

Re: SVG including an image without file extension

Posted: 2014-09-10T05:18:17-07:00
by Robar
dlemstra wrote:This looks like an issue in the library that reads the SVG file (librsvg). I will investigate this for you.
Big thx to you and your library :!:

Re: SVG including an image without file extension

Posted: 2014-09-10T07:52:00-07:00
by dlemstra
I looked through the code of the librsvg library and it does not read the content-type headers. You can request this feature here: https://wiki.gnome.org/Projects/LibRsvg.

Re: SVG including an image without file extension

Posted: 2014-09-11T00:44:01-07:00
by Robar
dlemstra wrote:I looked through the code of the librsvg library and it does not read the content-type headers. You can request this feature here: https://wiki.gnome.org/Projects/LibRsvg.
Thanks for your look up, I've filed a bug https://bugzilla.gnome.org/show_bug.cgi?id=736456, maybe it gets resolved.

Re: SVG including an image without file extension

Posted: 2014-09-11T03:12:52-07:00
by dlemstra
Can you send me a PM or contact me through CodePlex (https://www.codeplex.com/site/users/view/dlemstra) if they add this feature? I will then upgrade our local repository of libsrvg to the latest version.

Re: SVG including an image without file extension

Posted: 2014-09-11T06:54:41-07:00
by Robar
dlemstra wrote:Can you send me a PM or contact me through CodePlex (https://www.codeplex.com/site/users/view/dlemstra) if they add this feature? I will then upgrade our local repository of libsrvg to the latest version.
I think this issue will take a while, I added an entry in my calendar to look it up in 2 weeks, but for now I think I have to adjust my software to save the images with file extensions. If they add this feature or decline it in the next weeks I will contact you.