Page 1 of 1

Using Perl Image::Magick - extent gravity problem

Posted: 2009-10-18T01:35:19-07:00
by twotone
I'm resizing a large image to 700x700^ for display on the web which works fine, but then I want to make a thumbnail in a 150x150 geometry centered within a black background. It doesn't seem to be working correctly. Here are my results:

1 - No gravity setting
Image

Code: Select all

#!/usr/bin/perl -w
use strict;
use Image::Magick;

my($image);

$image = Image::Magick->new;
$image->Read('fire.jpg');

# make the display image
$image->Resize(geometry => '700x700^');
$image->Write('display.jpg');

# make the thumbnail image
$image->Resize(geometry => '150x150');
$image->Extent(geometry => '150x150', background => 'black');
$image->Write('thumbnail.jpg');

exit;
2 - gravity => 'Center'
Image

Code: Select all

...
$image->Extent(gravity => 'Center', geometry => '150x150', background => 'black');
$image->Write('thumbnail_center.jpg');
...
3 - gravity => 'East'
Image

Code: Select all

...
$image->Extent(gravity => 'East', geometry => '150x150', background => 'black');
$image->Write('thumbnail_east.jpg');
...
4 - gravity => 'West'
Image

Code: Select all

...
$image->Extent(gravity => 'West', geometry => '150x150', background => 'black');
$image->Write('thumbnail_west.jpg');
...
Is this a bug, or am I just doing it wrong?

I'm using:
Windows Vista Home Basic
ActivePerl v5.10.1 build 1006
ImageMagick 6.5.7 Q16

Re: Using Perl Image::Magick - extent gravity problem

Posted: 2009-10-18T06:53:47-07:00
by magick
We can reproduce the problem you reported and have a patch in ImageMagick-6.5.7-1 Beta available by sometime tomorrow. Thanks.

Re: Using Perl Image::Magick - extent gravity problem

Posted: 2009-10-18T07:15:47-07:00
by twotone
Great. Thank you.