ghostscript 9.26更新中断imagick readImage用于多页PDF [英] ghostscript 9.26 update breaks imagick readImage for multipage PDF

查看:247
本文介绍了ghostscript 9.26更新中断imagick readImage用于多页PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从昨天早上ghostscript更新9.25-> 9.26(在Debian上)以来,我们得到以下错误:

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

当尝试阅读多页PDF的第一页时:

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?

请参阅: https://www.ghostscript.com/doc /9.26/History9.htm#Version9.26 请参阅: https://secure.php.net/manual/en/imagick. readimage.php

推荐答案

我没有解决方案",但是可以确认问题,因为升级到gs 9.26.我发现,正如KenS指出的那样,在gs中删除参数-dFirstPage = 1 -dLastPage = 1时,一切工作正常.

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.

还可以执行的操作是删除gs参数-dMaxBitmap = 500000000.在PHP中的含义,删除[PAGE],即:

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');

我的工作解决方案是降级到ghostscript 9.22.我正在使用Ubuntu仿生LTS.因此,我必须运行:

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

这篇关于ghostscript 9.26更新中断imagick readImage用于多页PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆