Gossamer Forum
Home : General : Perl Programming :

Re: [Andy] Image::Magick showing blank images on some server, but not others?

Quote Reply
Re: [Andy] Image::Magick showing blank images on some server, but not others? In reply to
Managed to track it down to this line;

Code:
print $image->Set(size=>'110x50') || die &error($! . __LINE__);

That is line 14, in the full routine below;

Code:
# this is the routine we will run when creating
# an Image::Magick image...
sub gen_Magick {

# grab stuff we need...
my ($string,$date) = @_;

# now we have our 'random' string, and date stuff, lets create the image...
use Image::Magick;

my $image = Image::Magick->new();
print $image->Set(size=>'110x50') || die &error($! . __LINE__);
print $image->ReadImage('xc:white') || die &error($! . __LINE__);
print $image->Colorize( fill => $BackgroundColor ) || die &error($! . __LINE__);
print $image->Border( width => 5, height => 5, fill => $BorderColor ) || die &error($! . __LINE__);

# only do these things if the user has decided to...
if ($DoRaise) {
print $image->Raise( width => 5, height => 5, raise => 'True' ) || die &error($! . __LINE__);
}

# only do these things if the user has decided to...
if ($DoWave) {
print $image->Wave( amplitude => 5, wavelength => 30 ) || die &error($! . __LINE__);
}

# decide a random font to use...
my @fonts = ('Charter','Arial');
my @number= (0..2);
my $rand = int(rand scalar(@number));
my $font = $fonts[$rand]; #"Charter";

# annotate the image, so we have our string they need to enter...
print $image->Annotate(
text => $string,
fill => $TextColor,
x => 15,
y => 30,
pointsize=> 15,
font => $font) || die &error($! . __LINE__);


# setup some paths/urls etc...
my $path = $CFG->{build_root_path} . "/AddImages/" . $date . ".gif";
my $url = $CFG->{build_root_url};

print $image->Write($path) || die &error($! . __LINE__);
undef $image;

# pass stuff back into our templates....
$IN->param( SessionDate => $date );
$IN->param( ImageURL => "$url/AddImages/$date.gif" );

}

sub error {

my $error = $_[0];

print $IN->header();
print "An error occured. It was: $error";
exit;

}

1;



Perl version is reported as 5.8.1 (see below);

Quote:
[gossamer@roger home]$ perl -v

This is perl, v5.8.1 built for i686-linux

Copyright 1987-2003, Larry Wall

Image::Magick's version.h file contains;

Quote:
#define MagickLibVersion 0x557
#define MagickLibVersionText "5.5.7"
#define MagickLibVersionNumber 5,5,7,2

That any help to anyone?

TIA

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Image::Magick showing blank images on some server, but not others? Andy 6363 Oct 17, 2003, 9:22 AM
Thread Re: [Andy] Image::Magick showing blank images on some server, but not others?
Wil 6219 Oct 17, 2003, 10:10 AM
Thread Re: [Wil] Image::Magick showing blank images on some server, but not others?
Andy 6230 Oct 17, 2003, 10:13 AM
Thread Re: [Andy] Image::Magick showing blank images on some server, but not others?
Andy 6197 Oct 23, 2003, 7:10 AM
Thread Re: [Andy] Image::Magick showing blank images on some server, but not others?
Alex 6167 Oct 23, 2003, 6:45 PM
Thread Re: [Alex] Image::Magick showing blank images on some server, but not others?
Andy 6152 Oct 24, 2003, 7:22 AM
Post Re: [Andy] Image::Magick showing blank images on some server, but not others?
Andy 6083 Oct 28, 2003, 9:33 AM