Page 1 of 1

Getting MagickPNGErrorHandler/1711

Posted: 2017-09-17T00:37:41-07:00
by MarioPalmero
Hi!

I'm trying to test a simple program but when I use the method Image::write() I get an error:
WriteBlob Failed "C:/image.png" @ error/png.c/MagickPNGErrorHandler/1711

My code:

Code: Select all

InitializeMagick("");
try
{
		Image image(Geometry(2480, 3508), Color::Color(1, 1, 1, 1));
		image.write("C:/image.png");
}
catch (Exception &error_)
{
	std::printf("Caught exception: %s\n", error_.what());
	return 1;
}
My platform is Win64.

Can anybody help me with this?

Re: Getting MagickPNGErrorHandler/1711

Posted: 2017-09-17T01:16:09-07:00
by snibgo
In Windows, the directory separator is backslash \ not forward slash / , so try that. Do you have permission to write to the root of C:? (Even if you do, it's not a good idea.)

Re: Getting MagickPNGErrorHandler/1711

Posted: 2017-09-17T08:16:02-07:00
by MarioPalmero
Thanks, snibgo. I think it was the root path that was wrong. Now works fine with MyDocuments path.