array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'imagick.getsize.php', 1 => 'Imagick::getSize', ), 'up' => array ( 0 => 'class.imagick.php', 1 => 'Imagick', ), 'prev' => array ( 0 => 'imagick.getsamplingfactors.php', 1 => 'Imagick::getSamplingFactors', ), 'next' => array ( 0 => 'imagick.getsizeoffset.php', 1 => 'Imagick::getSizeOffset', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/imagick/imagick/getsize.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL imagick 2, PECL imagick 3)
Imagick::getSize — Returns the size associated with the Imagick object
Get the size in pixels associated with the Imagick object, previously set by Imagick::setSize().
Hinweis:
This method just returns the size that was set using Imagick::setSize(). If you want to get the actual width / height of the image, use Imagick::getImageWidth() and Imagick::getImageHeight().
Diese Funktion besitzt keine Parameter.
Returns the size associated with the Imagick object as an array with the keys "columns" and "rows".
Beispiel #1 Getting the size of a raw RGB image set at 200x400, after scaling to 400x800 (compared to width / height)
<?php
//Set size first and then load the raw image
$img = new Imagick();
$img->setSize(200, 400);
$img->readImage("image.rgb");
$img->scaleImage(400, 800);
$size = $img->getSize();
print_r($size);
echo $img->getImageWidth()."x".$img->getImageHeight();
?>
Das oben gezeigte Beispiel erzeugt folgende Ausgabe:
Array ( [columns] => 200 [rows] => 400 ) 400x800