如何关闭PHP Imagick的readimage警告

时间:2015-07-15 19:28:51

标签: php imagick

我正在使用PHP包Imagick。当我调用方法readimage时,我会收到一些PDF的恼人警告:

 **** This file had errors that were repaired or ignored.
 **** The file was produced by:
 **** >>>>  <<<<
 **** Please notify the author of the software that produced this
 **** file that it does not conform to Adobe's published PDF
 **** specification.

这是我正在使用的完整代码:

$img = new Imagick();
$img->setResolution(100, 100);
$img->readimage("scan-qr.pdf[0]");
$img->setImageFormat('gif');
$img->writeImage("scan-qr-$quality.gif");
$img->clear();
$img->destroy();

有关如何关闭此警告的任何想法?

1 个答案:

答案 0 :(得分:0)

尝试在php页面的开头添加它,

error_reporting(0);