0
The problem is this: it no longer generates any image... My script has stopped working, apparently after an Imagemagick update. When I searched for answers I saw many complained that the script stopped working in the same situation, recent posts this month or last month.
I complained about hosting, since I have no way to go into this issue, since what actually converts from PDF to JPEG is Ghostscript. They answered that this is a "development issue", that this support is not part of the package. That’s it?
The line that generates error is as follows:
$Img->readImage($urlArq."[".$pag."]");
The mistake:
Fatal error: Uncaught exception 'ImagickException' with message 'PDFDelegateFailed `[ghostscript library] -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r150x150" -dFirstPage=1 -dLastPage=1 "-sOutputFile=/tmp/magick-316787_tM5qhaBA3E%d" "-f/tmp/magick-316787MBoQDwPMLvz" "-f/tmp/magick-31678SNvHB_Zdq8Xt"': -dname= must be followed by a valid token @ error/pdf.c/InvokePDFDelegate/263' in /home/sintrano/public_html/conteudo_apitaco_jpeg.php:23 Stack trace: #0 /home/sintrano/public_html/conteudo_apitaco_jpeg.php(23): Imagick->readimage('apitaco/edicao-...') #1 {main} thrown in /home/sintrano/public_html/conteudo_apitaco_jpeg.php on line 23
The version:
versionNumber: 1680
versionString: ImageMagick 6.9.0-0 Q16 x86_64 2016-05-05 http://www.imagemagick.org
Can I just say they’re taking the body out and you have to fix it? There are alternatives if they do not want to touch Ghostscript since it is a shared server?
Post the log that PHP generates, in php.ini has the path from where the log is saved, or you can use
phpinfo()
, how the log will be possible to know where the fault is. I believe the problem may have been with the memory exceeded.– Guilherme Nascimento
The error I posted above is php’s return, I just added an error_reporting and ini_set at the beginning because it’s a small script that I added a "test mode".
– Gustavo
From what I noticed the server is linux, tells me one thing to the folder this marks as read and write?
– Guilherme Nascimento
I don’t have access because it’s a shared server. But from the tests I did, the problem is that before page zero returned to the first page, now it has to be "1". Page "0" gives error in Ghostscript and consequently a fatal error in Imagick.
– Gustavo