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