Hi
I am developing software in Perl for a webcam application. I am trying to use imagemagick to add a logo to an image.
Below is the test program that used to run, but doesn't anymore.
From what I have found in the web, it appears I have a clash of versions. I think this occured as a result of apt-get upgrades.
To try and fix this I have uninstalled and reinstalled perlmagick and imagemagick using apt-get. That didn't fix the problem.
So I am now stuck. I don't know where to turn.
If I have a clash of incompatible versions, how do I fix that???
Code:
#!/usr/bin/perl
# ===========================================================
use warnings;
use strict;
use Image::Magick;
my $imageFile = "/var/images/trackcam1/lastsnap.jpg";
my $logoFile = '/home/darren/logo1.jpg';
my $logo=Image::Magick->New();
$logo->Read($logoFile);
my $image=Image::Magick->New();
$image->Read($imageFile);
my $webImage = $image->Composite(image=>$logo, gravity=>'NorthWest');
$webImage->Set(quality=>100);
$webImage->Write("jpg:/var/images/trackcam1.jpg");
undef $imageFile;
undef $logoFile;
undef $webImage;
exit 1;
Running the composite test program with the debugger gave the following error:
Code:
main::(compositeTest.pl:18): $webImage->Set(quality=>100);
DB<1>
Can't locate object method "Set" via package "Exception 410: reference is not my type
`Image::Magick' @ error/Magick.xs/XS_Image__Magick_Mogrify/7505"
(perhaps you forgot to load
"Exception 410: reference is not my type
`Image::Magick' @ error/Magick.xs/XS_Image__Magick_Mogrify/7505"?) at compositeTest.pl line 18.
at compositeTest.pl line 18
The version of perl is:
Code:
darren@alpha:~$ perl -v
This is perl 5, version 14, subversion 2 (v5.14.2) built for i686-linux-gnu-thread-multi-64int
The imagemagick version is:
Code:
darren@alpha:~$ composite -version
Version: ImageMagick 6.6.9-7 2012-08-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
The Ubuntu server version is:
Code:
darren@alpha:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.2 LTS
Release: 12.04
Codename: precise
The version of PerlMagick is:
Code:
precise (perl): Perl interface to the ImageMagick graphics routines
8:6.6.9.7-5ubuntu3.2 [security]: amd64 i386
also provided by: graphicsmagick-libmagick-dev-compat
precise-updates (perl): Perl interface to the ImageMagick graphics routines
8:6.6.9.7-5ubuntu3.2: amd64 i386
Bookmarks