Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
MarioPalmero
Posts: 2 Joined: 2017-09-17T00:27:57-07:00
Authentication code: 1151
Contact:
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: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Contact:
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.)
MarioPalmero
Posts: 2 Joined: 2017-09-17T00:27:57-07:00
Authentication code: 1151
Contact:
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.
Users browsing this forum: Amazon [Bot] and 9 guests