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
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');
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?