Page 1 of 1

PerlMagick Splice not correctly honoring gravity

Posted: 2014-08-14T21:55:44-07:00
by jmcd73
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?

Re: PerlMagick Splice not correctly honoring gravity

Posted: 2014-08-15T05:39:33-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.9-7 Beta available by sometime tomorrow. Thanks.