Issues with translate in PerlMagick in Ubuntu 10.04

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
dwm042
Posts: 2
Joined: 2011-07-23T07:51:54-07:00
Authentication code: 8675308

Issues with translate in PerlMagick in Ubuntu 10.04

Post by dwm042 » 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.

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
On my servers, this does not center the circle.

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");
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

User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Issues with translate in PerlMagick in Ubuntu 10.04

Post by anthony » 2011-07-25T21:20:37-07:00

I would not recommend using the CPAN modulefor IM. It depend too heavily on the current version of Imagemagick. Use the module Imagemagick source creates along with the library. For example when creating RPM's from IM source
http://www.imagemagick.org/Usage/api/#rpms

NOTE no one has provided feedback on how to create DEB modules for ubuntu.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

dwm042
Posts: 2
Joined: 2011-07-23T07:51:54-07:00
Authentication code: 8675308

Re: Issues with translate in PerlMagick in Ubuntu 10.04

Post by dwm042 » 2011-07-27T18:54:38-07:00

I'm seeing the same issues in stock Ubuntu 11.04, as built inside VirtualBox. That one is v 6.63.

I haven't tested Fedora yet, though I've just built a version of Fedora 15.

~~

There are a couple ways to create a .deb file.

One way is given here: http://www.webupd8.org/2010/01/how-to-c ... ebian.html

The other is the alien tool, which converts RPMs into DEBs.

https://help.ubuntu.com/community/RPM/AlienHowto

Post Reply