//file location c:/htdocs/rose.jpg
$image=new Imagick("c:/htdocs/rose.jpg");
$height=$image->getImageHeight();
print "the image height is ".$height;
result:
the image height is 134
PHP - Manual: Imagick::getImageHeight
2024-12-21
(PECL imagick 2, PECL imagick 3)
Imagick::getImageHeight — Returns the image height
Returns the image height.
此函数没有参数。
Returns the image height in pixels.
错误时抛出 ImagickException。
//file location c:/htdocs/rose.jpg
$image=new Imagick("c:/htdocs/rose.jpg");
$height=$image->getImageHeight();
print "the image height is ".$height;
result:
the image height is 134
官方地址:https://www.php.net/manual/en/imagick.getimageheight.php