Using Perl Image::Magick - extent gravity problem

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
twotone

Using Perl Image::Magick - extent gravity problem

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
twotone

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

Post by twotone »

Great. Thank you.
Post Reply