What's the right way to get all the image geometry, including page info?
I tried
$geom = $image->Get('geometry');
but this returns zilch (I'm still with 6.3.1-4). Using
($w,$h) = $image->Get('width', 'height');
and
($c,$r) = $image->Get('columns', 'rows');
both return identical (synonymous?) results, but I was hoping 'geometry' would give me the works: (width)x(height)+page.x+page.y.
Rick
Get('geometry')
magick wrote: Use $image->Get('columns') to return the image width, Get('rows') for the image height, and Get('page') to get the page geometry (page width, height, x, and y). The page width/height may be different from the image width/height because it represents the image virtual canvas.
Thanks, yes, 'page' is exactly what I thought 'geometry' would give. (What DOES 'geometry' return?)
magick wrote: Get('page') to get the page geometry (page width, height, x, and y).
Without resorting to split-ing or other perly string manipulations (which wouldn't be difficult, I'll grant), are the x and y ready to Get separately? E.g.,
$image->Get('pagex', 'pagey') ?
How's this?
Code: Select all
if (LocaleCompare(attribute,"pagex") == 0)
{
if (image != (Image *) NULL)
s=newSViv((long) image->page.x);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
}
if (LocaleCompare(attribute,"pagey") == 0)
{
if (image != (Image *) NULL)
s=newSViv((long) image->page.y);
PUSHs(s ? sv_2mortal(s) : &sv_undef);
continue;
}
"Can we keep it, Dad, please, can we keep it?"
(Used to work when we were kids.)