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

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
swapnilkhare
Posts: 3
Joined: 2017-02-16T02:49:49-07:00
Authentication code: 1151

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

Post 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 ?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post by snibgo »

You may need to install the built program, which just means moving sampleIM.exe to the directory that contains magick.exe etc.
snibgo's IM pages: im.snibgo.com
swapnilkhare
Posts: 3
Joined: 2017-02-16T02:49:49-07:00
Authentication code: 1151

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

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
swapnilkhare
Posts: 3
Joined: 2017-02-16T02:49:49-07:00
Authentication code: 1151

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

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

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