Page 1 of 1

Perl script just dies at Annotate

Posted: 2016-09-03T13:13:54-07:00
by pbeitbeor
Recently I've upgraded my Ubuntu to 16.04.1 LTS. After this update, my Perl script just dies, without any errors, at the following command:

Code: Select all

$image->Annotate(font=>'arial.ttf', pointsize=>10, gravity=>'center', fill=>'black', text=>$title);
This has worked perfectly before.
And even the 'Hello World' alternative:

Code: Select all

$text = 'Works like magick!';
$image->Annotate(font=>'kai.ttf', pointsize=>40, fill=>'green', text=>$text);
gives the same result. Narrowing down by leaving out options also doesn't give a hint.

I've reinstalled imagemagick, perlmagick and libimage-magick-perl with the same result.
All other PerlMagick commands work perfectly.

I've traced the script with strace -f and there also the process just vanishes.

These are all the ImageMagick packages installed on my system:
  • imagemagick 8:6.8.9.9-7ubuntu5.1
    imagemagick-6.q16 8:6.8.9.9-7ubuntu5.1
    imagemagick-common 8:6.8.9.9-7ubuntu5.1
    libimage-magick-perl 8:6.8.9.9-7ubuntu5.1
    libimage-magick-q16-perl 8:6.8.9.9-7ubuntu5.1
    libmagickcore-6.q16-2:i386 8:6.8.9.9-7ubuntu5.1
    libmagickcore-6.q16-2-extra:i386 8:6.8.9.9-7ubuntu5.1
    libmagickcore5:i386 8:6.7.7.10-6ubuntu3.1
    libmagickwand-6.q16-2:i386 8:6.8.9.9-7ubuntu5.1
    libmagickwand5:i386 8:6.7.7.10-6ubuntu3.1
    perlmagick 8:6.8.9.9-7ubuntu5.1
    php-imagick 3.4.0~rc6-1ubuntu3
    php5-imagick 3.1.2-1build1
Hope someone can help me.

Re: Perl script just dies at Annotate

Posted: 2016-09-03T14:13:37-07:00
by fmw42
I do not know PerlMagick, but it looks like you may have two different versions installed that are conflicting.

I see a version 6.7.7.10 and a version 6.8.9.9

Have you tried removing all IM versions and starting over with the most recent one you can?

Re: Perl script just dies at Annotate

Posted: 2016-09-04T01:26:46-07:00
by pbeitbeor
Hi Fred,

thanks for your hint. I removed/purged it all and reinstalled it, but the problem is still there.

Code: Select all

imagemagick                      8:6.8.9.9-7ubuntu5.1
imagemagick-6.q16                8:6.8.9.9-7ubuntu5.1
imagemagick-common               8:6.8.9.9-7ubuntu5.1
libimage-magick-perl             8:6.8.9.9-7ubuntu5.1
libimage-magick-q16-perl         8:6.8.9.9-7ubuntu5.1
libmagickcore-6.q16-2:i386       8:6.8.9.9-7ubuntu5.1
libmagickcore-6.q16-2-extra:i386 8:6.8.9.9-7ubuntu5.1
libmagickwand-6.q16-2:i386       8:6.8.9.9-7ubuntu5.1
perlmagick                       8:6.8.9.9-7ubuntu5.1
php-imagick                      3.4.0~rc6-1ubuntu3
I also did some testing with php and annotateImage, on the same machine and that worked perfect.
So no issues in the shared libraries.

For now I have a workaround by using convert (with annotate) as a system command.

Still I would like to have a proper perlmagick solution. Any other thoughts?

Re: Perl script just dies at Annotate

Posted: 2016-09-04T10:26:00-07:00
by fmw42
I am no expert on this. Just to be safe though, do you have Perl installed and in a way that IM can find it. Also have you read http://www.imagemagick.org/script/perl-magick.php and are there any hints there?

Re: Perl script just dies at Annotate

Posted: 2016-09-04T11:59:13-07:00
by pbeitbeor
Yes, Perl is correctly installed in this context. And all the other IM functions I use are working fine.
Of those it's only Annotate that gives this strange behaviour.
To give some more info, I Read images, use Blur, Resize and use ImageToBlob which all work fine.

I did read the PerlMagick pages, but no hints to solve my problem.

I feel like it's a bug, because it occured after a release upgrade of Ubuntu, before that, the same Annotate function worked fine.
For now I leave it to the workaround with convert and see if the problem is gone when a new version of PerlMagick is released.

Thanks for your support.

Re: Perl script just dies at Annotate

Posted: 2016-09-04T12:42:37-07:00
by fmw42
Can you upgrade to a more current version of IM? Perhaps there was a bug in annotate. Also you could try annotate in the command line and see if it has the same issue.

Also check the changelog at http://legacy.imagemagick.org/script/changelog.php to see if any indication of a bug fix at a late version.

Re: Perl script just dies at Annotate

Posted: 2016-09-04T13:49:40-07:00
by pbeitbeor
Is there a newer version somewhere? With apt-get I get:

Code: Select all

$ sudo apt-get install imagemagick
Reading package lists... Done
Building dependency tree
Reading state information... Done
imagemagick is already the newest version (8:6.8.9.9-7ubuntu5.1).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

Re: Perl script just dies at Annotate

Posted: 2016-09-04T13:55:25-07:00
by fmw42
I do not use Linux. So the only place I know is http://www.imagemagick.org/script/binary-releases.php for binaries and http://www.imagemagick.org/script/insta ... e.php#unix for source.

Does annotate work from the command line?

Re: Perl script just dies at Annotate

Posted: 2016-09-07T12:14:03-07:00
by pbeitbeor
I've tried the command line and it works fine. By the way, it's the alternative I use right now.

I've checked both sites. For PerlMagick, I have the latest version installed. I also have the same version of ImageMagick.
There are newer version of IM, but I don't think it's wise to mix versions.

But it's o.k. for now. The alternative will do. When there is a new version, I will try that one.

Thanks again.

Re: Perl script just dies at Annotate

Posted: 2016-09-07T12:46:22-07:00
by fmw42
OK. If it works from the command line, then it is a PerlMagick issue. A newer version might have that fixed.