ghostscript 9.26 update breaks imagick readImage for multipage PDF

柔情痞子 提交于 2019-11-30 23:42:06

Almost certainly this bug report:

https://bugs.ghostscript.com/show_bug.cgi?id=699815

Your solutions are; don't use the pngalpha device, don't use FirstPage/LastPage, upgrade to a version with the fix, or downgrade to an earlier version. Though that bug is potentially present in many earlier versions, I don't know why it hasn't exhibited before.

I don't have "a solution" but can confirm the problem since upgrading to gs 9.26. I figured out, that, as KenS pointed out, everything works fine when removing the parameters -dFirstPage=1 -dLastPage=1 in gs.

What also works is to remove the gs-parameter -dMaxBitmap=500000000. Meaning in PHP, remove the [PAGE] i.e.:

$im = new \Imagick();
$im->readImage('/tmp/test.pdf');

My Working solution was a downgrade to ghostscript 9.22. I am using Ubuntu bionic LTS. Therefore I had to run:

sudo apt-get remove ghostscript
sudo apt-get autoremove
sudo apt-get install ghostscript=9.22~dfsg+1-0ubuntu1 libgs9=9.22~dfsg+1-0ubuntu1 libgs9-common=9.22~dfsg+1-0ubuntu1
sudo apt-mark auto libgs9
sudo apt-mark auto libgs9-common
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!