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 ?
Image is unable to load any file, exception no decode delegate for this image format
-
- Posts: 3
- Joined: 2017-02-16T02:49:49-07:00
- Authentication code: 1151
-
- 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
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
-
- Posts: 3
- Joined: 2017-02-16T02:49:49-07:00
- Authentication code: 1151
-
- 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
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.
If that doesn't help, I have other thoughts.
snibgo's IM pages: im.snibgo.com
-
- 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
Sorry I was trying out combination and copied by mistake, I tried with "test.pdf" first, but it was not working
-
- 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
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.
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