SVG including an image without file extension

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Locked
Robar
Posts: 8
Joined: 2013-12-11T00:26:12-07:00
Authentication code: 6789

SVG including an image without file extension

Post 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?

User avatar
dlemstra
Posts: 1625
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: SVG including an image without file extension

Post by dlemstra »

This looks like an issue in the library that reads the SVG file (librsvg). I will investigate this for you.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

Robar
Posts: 8
Joined: 2013-12-11T00:26:12-07:00
Authentication code: 6789

Re: SVG including an image without file extension

Post 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 :!:

User avatar
dlemstra
Posts: 1625
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: SVG including an image without file extension

Post 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.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

Robar
Posts: 8
Joined: 2013-12-11T00:26:12-07:00
Authentication code: 6789

Re: SVG including an image without file extension

Post 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.

User avatar
dlemstra
Posts: 1625
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: SVG including an image without file extension

Post 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.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

Robar
Posts: 8
Joined: 2013-12-11T00:26:12-07:00
Authentication code: 6789

Re: SVG including an image without file extension

Post 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.

Locked