Imagick
在线手册:中文 英文
PHP手册

Imagick::getImageResolution

(PECL imagick 2.0.0)

Imagick::getImageResolutionGets the image X and Y resolution

说明

array Imagick::getImageResolution ( void )

Gets the image X and Y resolution.

返回值

Returns the resolution as an array.

错误/异常

错误时抛出 ImagickException .


Imagick
在线手册:中文 英文
PHP手册
PHP手册 - N: Gets the image X and Y resolution

用户评论:

Shawn Pyle (18-Apr-2011 08:53)

As of the following versions, the results of this function returns the x and y resolution as floats.

desktop:~$ convert --version
Version: ImageMagick 6.6.9-1 2011-04-14 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP OpenCL

desktop:~$ pecl list
Installed packages, channel pecl.php.net:
==========================
Package Version State
imagick 3.0.1   stable

desktop:~$ php --version
PHP 5.3.5 (cli) (built: Mar  1 2011 12:57:53)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans

perching_eagle at yahoo dot com (05-Oct-2007 02:14)

//location of image: c:/htdocs/rose.jpg
$path="c:/htdocs/";
$image=new Imagick($path."rose.jpg");
$array=$image->getImageResolution();
print_r($array);

result:
Array
(
    [x]=>75
    [y]=>75
)