Page 1 of 1

Image is unable to load any file, exception no decode delegate for this image format

Posted: 2017-02-16T03:09:09-07:00
by swapnilkhare
Hello I have just started with IM++ and I am stuck with my first program.
Here is what I got from sample code -
int _tmain(int argc, _TCHAR* argv[])
{
InitializeMagick("");
Image image;
try
{
image.read("'test.pdf'");

image.write( "testImageMagick.jpg" );
}
catch( Exception &error_ )
{
cout << "Caught exception: " << error_.what() << endl;
}
return 0;
}

I am using visual studio V9.0 on Windows-7 (64 bit) PC and I have installed ImageMagick-7.0.4-Q16 and GhostScript (gs9.16) on my pc.
when I run above code, read throw exception and details are -
"Caught exception: sampleIM.exe: no decode delegate for this image format `' @ error/constitute.c/ReadImage/509"

Please someone can suggest what is going wrong ?

Re: Image is unable to load any file, exception no decode delegate for this image format

Posted: 2017-02-16T03:21:45-07:00
by snibgo
You may need to install the built program, which just means moving sampleIM.exe to the directory that contains magick.exe etc.

Re: Image is unable to load any file, exception no decode delegate for this image format

Posted: 2017-02-16T04:04:43-07:00
by swapnilkhare
snibgo wrote: 2017-02-16T03:21:45-07:00 You may need to install the built program, which just means moving sampleIM.exe to the directory that contains magick.exe etc.
Thanks a lot for suggestion, I tried now but same exception

Re: Image is unable to load any file, exception no decode delegate for this image format

Posted: 2017-02-16T04:48:57-07:00
by snibgo
Okay. You have two sets of quotes in "'test.pdf'". Why? Is the filename really 'test.pdf' including the quotes? Seems like a bad idea.

If that doesn't help, I have other thoughts.

Re: Image is unable to load any file, exception no decode delegate for this image format

Posted: 2017-02-17T06:15:19-07:00
by swapnilkhare
snibgo wrote: 2017-02-16T04:48:57-07:00 Okay. You have two sets of quotes in "'test.pdf'". Why? Is the filename really 'test.pdf' including the quotes? Seems like a bad idea.

If that doesn't help, I have other thoughts.
Sorry I was trying out combination and copied by mistake, I tried with "test.pdf" first, but it was not working

Re: Image is unable to load any file, exception no decode delegate for this image format

Posted: 2017-02-17T07:17:44-07:00
by snibgo
I suggest you read "rose:" instead of a PDF. Does this work? If not, what is the error message?

I don't use Visual Studio. Perhaps you need to tell it where to find the ImageMagick libraries.