Page 1 of 1

Error when loading SVG in Magick++

Posted: 2010-01-05T16:03:30-07:00
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.

Re: Error when loading SVG in Magick++

Posted: 2010-01-06T08:09:51-07:00
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.

Re: Error when loading SVG in Magick++

Posted: 2010-01-06T11:16:15-07:00
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.