Page 1 of 1

crop + page different in command line to perl

Posted: 2013-04-10T10:52:26-07:00
by mack3457
Hi!

If I use

Code: Select all

convert input.tif -crop 400x300+301-143 -page 400x300+0+143 output.gif
I get the desired result, which is a 400x300 pixel image with the top 143 pixel blank.

When I'm using the perlmagick version of it:

Code: Select all

$image->Crop(geometry => "400x300+301-143");
$image->Set(page => "400x300+0+143");
I end up with a 300x400 pixel image file of a horizontal image strip starting at 143 pixel from the top: the rest is blank.

For some funny reason, geometries of

Code: Select all

-crop 400x300-99-143 -page 400x300+99+143
give me the desired result in perlmagick as well.

What am I missing here?

Thomas Mack

Re: crop + page different in command line to perl

Posted: 2013-05-01T22:23:50-07:00
by anthony
Set page is equivelent to doing a -repage which sets virtual canvas information on the image.

What you want to do is set the page for the write (image info). I am not however certain how you would do this in PerlMagick though.

It should however be the same as setting the page before reading an image, so a read postscript example may provide the answer.