开发者

Imagick knowing the image size? (file size)

 $im = new Imagick($path);
 $im->re开发者_JS百科sizeImage();

 echo $im->calc_image_size(); ? //> 121312 Bytes

Is there a calc_image_size or I have to write in a file and check the dimension? (fail)


getImageSize throws a Deprecated.

Imagick::getImageSize is deprecated. Imagick::getImageLength should be used instead

http://php.net/manual/en/function.imagick-getimagelength.php


If you compress the image you can determine the size like this

$data = $im->__toString();
$imageSize = strlen($data);


See this Imagick::getImageSize

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜