Page 1 of 1

trouble with getimageresolution and getimagegeometry

Posted: 2007-09-12T21:31:31-07:00
by goonatic
So far most imagick functions work for me. I seem to be having problems with the functions that return arrays.

$im = new Imagick();
$filename = 'junk.jpg';
$im -> readImage($filename);
$photobytes = $im ->getImageSize();
$photoheight = $im ->getImageHeight();
$photowidth = $im ->getImageWidth();
// the above functions work and return values that I expect
//the functions below do not return any values
$geometry = $im->getImageGeometry();
$geomX = $geometry[0];
$geomY = $geometry[1];
$resolution = $im->getImageResolution();
$resX = $resolution[0];
$resY = $resolution[1];

The resolution and geometry arrays are empty.
Am I missing something simple?

Thanks,
Mark

Re: trouble with getimageresolution and getimagegeometry

Posted: 2007-09-13T04:48:48-07:00
by mkoppanen
$im = new imagick( "a.jpg" );
var_dump( $im->getImageGeometry() );

array(2) {
["width"]=>
int(775)
["height"]=>
int(1386)
}

It is an associative array.

Re: trouble with getimageresolution and getimagegeometry

Posted: 2007-09-13T06:14:36-07:00
by goonatic
Thanks Mikko,
That was it. I knew it was something simple.

Mark