开发者

Imagick knowing the image size? (file size)

开发者 https://www.devze.com 2023-02-16 16:23 出处:网络
$im = new Imagick($path); $im->re开发者_JS百科sizeImage(); echo $im->calc_image_size(); ? //> 121312 Bytes
 $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

精彩评论

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