Since the ghostscript update 9.25 -> 9.26 (on debian) last morning we get this error:
ErrorMessage: FailedToExecuteCommand
`'gs' -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT
-dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2
'-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r300x300'
-dFirstPage=1 -dLastPage=1 '-sOutputFile=/tmp/magick-39903EapVvuyNQxL4%d'
'-f/tmp/magick-39903VD0GMIpLPaIN'
'-f/tmp/magick-399031owlSOb4aOEw'' (-1)
@ error/delegate.c/ExternalDelegateCommand/462
When trying to read the first page of a multipage PDF:
$this->resource = new \Imagick();
$this->resource->setResolution(300, 300);
$this->resource->readImage($path . '[0]');
any idea how this problem can be solved?
See: https://www.ghostscript.com/doc/9.26/History9.htm#Version9.26 See: https://secure.php.net/manual/en/imagick.readimage.php
scaleImage
resets the value ofsetImageDepth
. So make sure to set the depth at the end of your image operations. - ownking