0

次のコードで奇妙な問題が発生しました。

$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)
4

1 に答える 1

1

さらに調査を行ったところ、画像が CMYK かどうかを確認しました。次のコードで理由が修正されたことがわかりましたが、エラーは修正されません。

$image = new Imagick($real_location);
$ident = $image->getImageColorspace();  
if($ident ==  Imagick::COLORSPACE_CMYK) {

}
于 2012-03-26T15:02:56.563 に答える