Page 1 of 1

Erratic behavior of new Imagick()

Posted: 2010-04-12T02:32:14-07:00
by ppick
My php code looks like this:

Code: Select all

    
    $file1 = 'http://www.ada.gov/newsltr0606.pdf';
    $im1 = new Imagick($file1);  

    $file2 = 'http://www.nano.gov/NNI_SigInit_Nanoelectronics_Feb_2010.pdf';
    $im2 = new Imagick($file2);  
Both are valid pdf files. With the first pdf, everyhting works well and I can make a snapshot of the pdf. With the 2nd pdf, I get this error:

Wand contains no images `MagickWand-2'
and it catches an exception (does not work). Can anyone reproduce this issue? Why does it work in one case, not the other?

I am on a shared hosting plan, and I have no control about the version installed, which is by the way:


Image

My PHP version and system is:


Image

Re: Erratic behavior of new Imagick()

Posted: 2010-05-02T13:40:56-07:00
by mkoppanen
Hi,

the error means that the image could not be read. Imagick before 3.0.0 sent out wrong error message for read failures. Most likely the error is that 'gs' command is not in $PATH

Re: Erratic behavior of new Imagick()

Posted: 2010-05-03T00:22:44-07:00
by ppick
Yes, but I do not understand why it works for one of the 2 pdf files, not for the other. Both pdf files are existing files that can be accessed via a browser without error.

Can you reproduce this issue?

Re: Erratic behavior of new Imagick()

Posted: 2010-05-03T09:11:29-07:00
by Morgon
Can you copy the files locally with file_get_contents or the like? Perhaps it's a transmission error or something on the second site that prevents automated downloads?