©
本文档使用
php.cn手册 发布
(PECL imagick 2.0.0)
Imagick::getImageSize — Returns the image length in bytes
Returns the image length in bytes. Deprecated in favour of Imagick::getImageLength()
Returns an int containing the current image size.
[#1] murphy(at)murphyslantech(dot)de [2010-11-30 07:21:01]
If you get an error or warning (when using strict settings for PHP), telling you, that this function should not be used anymore try getImageLength() instead ...
[#2] Ricardo Cordts Monteiro [2010-02-12 04:11:49]
Practical use to get the dimensions of the image:
<?php
$image = new Imagick($image_src);
$d = $image->getImageGeometry();
$w = $d['width'];
$h = $d['height'];
?>
[#3] nikolaus [2009-10-17 00:52:52]
If you're planning to stream imagick images via http, pay attention that this function may return the uncompressed image size, so it's not directly suitable for setting the content-length http header.
[#4] benford at bluhelix dot com [2009-06-22 15:12:22]
Try Imagick::getSize, Imagick::getImageWidth, or Imagick::getImageHeight if you are looking to get dimensions in pixels (rows, columns) of the current image.
[#5] perching_eagle at yahoo dot com [2007-10-04 18:37:02]
$image=new Imagick("c:/htdocs/rose.jpg");
$size=$image->getImageSize();
print "the size of the picture is ".$size." bytes";
result
the size of the picture is 3461 bytes