PerlMagick Splice not correctly honoring gravity

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
jmcd73
Posts: 1
Joined: 2014-08-14T21:31:34-07:00
Authentication code: 6789

PerlMagick Splice not correctly honoring gravity

Post by jmcd73 » 2014-08-14T21:55:44-07:00

ImageMagick-6.8.6.3-4.fc20.x86_64
ImageMagick-perl-6.8.6.3-4.fc20.x86_64

This works fine from the command line:

Code: Select all

convert test.png -gravity south -background blue -splice 0x10 splice_bottom.png
Image

But the perlmagick version fails:

Code: Select all

#!/usr/bin/perl

use strict;
use Image::Magick;


my ($file, $top_right);

$file = $ARGV[0];

if ( ! -f $file ) {
	print "No such file. Exiting\n";
	exit 0;
}

$top_right = Image::Magick->new;
$top_right->read($file);

# add big white border
$top_right->Border(geometry=> '3%', bordercolor => 'white' );
my $width  = $top_right->Get('width');
my $height = $top_right->Get('height');

print "Width $width\n";
print "Height $height\n";

# this doesn't help
$top_right->Set( page=>'0x0+0+0');

# failing ignores gravity
$top_right->Splice(gravity=>'south', background=> 'orange', geometry => '0x20');

$top_right->Write('top_right.png');
Image

My suspicion is that when using the command line gravity is properly set first but that the values passed using perl magic aren't prioritized to make sure gravity is set correctly.

Anyone have a fix / work - a - round for this?

User avatar
magick
Site Admin
Posts: 11042
Joined: 2003-05-31T11:32:55-07:00

Re: PerlMagick Splice not correctly honoring gravity

Post by magick » 2014-08-15T05:39:33-07:00

We can reproduce the problem you posted and have a patch in ImageMagick 6.8.9-7 Beta available by sometime tomorrow. Thanks.

Post Reply