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
精彩评论