php8.5
Home/ Manual/ imagick / imagick/ Imagick::getImageGeometry

Imagick::getImageGeometry

PHP function Edit on GitHub ✎

(PECL imagick 2, PECL imagick 3)

Gets the width and height as an associative array

Description

Imagick::getImageGeometry(): array

Returns the width and height as an associative array.

Parameters Parameters

Return Values

Returns an array with the width/height of the image.

Errors/Exceptions

Throws

Examples

Using Imagick::getImageGeometry()

php
<?php
$imagick = new Imagick();
$imagick->newImage(100, 200, "black");
print_r($imagick->getImageGeometry());
?>

The above example will output:

output
Array
(
    [width] => 100
    [height] => 200
)

Source: reference/imagick/imagick/getimagegeometry.xml · from the official PHP manual (php/doc-en)