Getting MagickPNGErrorHandler/1711

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
MarioPalmero
Posts: 2
Joined: 2017-09-17T00:27:57-07:00
Authentication code: 1151

Getting MagickPNGErrorHandler/1711

Post by MarioPalmero » 2017-09-17T00:37:41-07:00

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?

snibgo
Posts: 9379
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Getting MagickPNGErrorHandler/1711

Post by snibgo » 2017-09-17T01:16:09-07:00

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.)
snibgo's IM pages: im.snibgo.com

MarioPalmero
Posts: 2
Joined: 2017-09-17T00:27:57-07:00
Authentication code: 1151

Re: Getting MagickPNGErrorHandler/1711

Post by MarioPalmero » 2017-09-17T08:16:02-07:00

Thanks, snibgo. I think it was the root path that was wrong. Now works fine with MyDocuments path.

Post Reply