Error when loading SVG in Magick++

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Svenstaro

Error when loading SVG in Magick++

Post by Svenstaro »

I get an error trying to load an SVG using Magick++:
Failed to load image "my-svg.svg". Reason : Image not of any known type, or corrupt
In fact, I get this error trying to load any of my SVGs. I used Inkscape to create them. Loading PNGs works fine. Using the convert utility to convert SVG to PNG works fine as well. Relevant code:

Code: Select all

Magick::Image mimage;
try {
	mimage.read("my-svg.svg");
	mimage.write("my-png.png");
}
catch (std::exception &error_) {
	std::cout << "ERROR: " << error_.what() << std::endl;
	return 1;
}
librsvg is v2.26.0. I am led to believe that this is indeed a bug. I'll be happy to provide my full program source in order to get the bug fixed but I'm really just trying to load the image into a Magick Image object.

EDIT: I am using Arch Linux x86_64. My ImageMagick version is 6.5.8-5.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Error when loading SVG in Magick++

Post by magick »

Unfortunately we cannot reproduce the problem you reported. We're using ImageMagick 6.5.8-10 and RSVG 2.26.0. When we run your code, it produces my-png.png without complaint.
Svenstaro

Re: Error when loading SVG in Magick++

Post by Svenstaro »

Sorry, I am stupid. You are indeed correct, there is no bug in Magick++. The error was from a conflict with a library I was linking against. Sorry again.
Post Reply