Page 1 of 1

Issues with translate in PerlMagick in Ubuntu 10.04

Posted: 2011-07-23T09:47:01-07:00
by dwm042
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

Re: Issues with translate in PerlMagick in Ubuntu 10.04

Posted: 2011-07-25T21:20:37-07:00
by anthony
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.

Re: Issues with translate in PerlMagick in Ubuntu 10.04

Posted: 2011-07-27T18:54:38-07:00
by dwm042
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