Issues with translate in PerlMagick in Ubuntu 10.04
Posted: 2011-07-23T09:47:01-07:00
Ubuntu 10.04 comes with a stock Image Magick 6.5.7 install and a stock Perl Magick 6.5.7 install and those are what I'll be discussing here.
I haven't tested on other platforms, and this problem may have been fixed elsewhere a long time ago.
In short, there appear to be translate issues in the PerlMagick interface of stock Ubuntu 10.04. I found these first on my desktop when translating Windows Batch files into Perl equivalents for my blog "Code and Football", and then wondered if this was 'everywhere'.
I can duplicate this issue on a clean install of Ubuntu 10.04 server on VirtualBox. Test code follows:
The shell script works.
On my servers, this does not center the circle.
The location of translate does not seem to affect this outcome, placing it at the beginning or end of the Draw also fails.
I haven't had any luck trying to compile Image::Magick from CPAN (blows up spectacularly), and this
may be resolved in Ubuntu 11.04 (haven't updated yet), but thought I would mention this, for others
that might run into the issue.
David Myers, CPAN ID DWMYERS
I haven't tested on other platforms, and this problem may have been fixed elsewhere a long time ago.
In short, there appear to be translate issues in the PerlMagick interface of stock Ubuntu 10.04. I found these first on my desktop when translating Windows Batch files into Perl equivalents for my blog "Code and Football", and then wondered if this was 'everywhere'.
I can duplicate this issue on a clean install of Ubuntu 10.04 server on VirtualBox. Test code follows:
The shell script works.
Code: Select all
#! /bin/bash
convert -size 100x100 -stroke SeaGreen -fill palegreen -strokewidth 2 \
xc:white -draw 'translate 50,50 circle 0,0,25,0' /share/circle_script.jpg
Code: Select all
#! /usr/bin/perl
use warnings;
use strict;
use Image::Magick;
my $p = Image::Magick->new;
$p->Set( size => '100x100');
$p->Read("xc:white");
$p->Draw( primitive => 'circle' ,translate => "50,50",
stroke => 'SeaGreen', strokewidth => 2, fill => 'palegreen',
points => '0,0,25,0' );
$p->Write("/share/circle_perl.jpg");
I haven't had any luck trying to compile Image::Magick from CPAN (blows up spectacularly), and this
may be resolved in Ubuntu 11.04 (haven't updated yet), but thought I would mention this, for others
that might run into the issue.
David Myers, CPAN ID DWMYERS