我遇到了以下代码的一个奇怪问题:
$image = new Imagick($real_location);
$ident = $image->identifyImage();
$format = $ident['colorSpace'];
在大多数情况下,这很好。但在某些照片上,它会重置连接,基本上看起来页面已经超时。
示例照片是 72dpi、3008x2000、包含 EXIF 数据、RGB、8 位通道的 JPG。
如果我像下面那样运行它,它很好:
exec("identify -format %r ".$real_location,$output);
但是,我宁愿远离 exec() 并尽可能坚持使用图书馆。
我查看了我的 PHP 错误日志,发现了以下内容:
httpd: magick/option.c:1264: GetImageOption: Assertion `image_info != (ImageInfo *) ((void *)0)' failed.
[Mon Mar 26 15:40:26 2012] [notice] child pid 1582 exit signal Aborted (6)