Gossamer Forum
Home : General : Perl Programming :

Image::Magick showing blank images on some server, but not others?

Quote Reply
Image::Magick showing blank images on some server, but not others?
Hi. Could anyone shed some light on why this code works ok on some server, but on others it shows a blank image? (i.e everything *but* the text)

Its got me baffled :(

TIA

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");
print $image->ReadImage('xc:white');
print $image->Colorize( fill => $BackgroundColor );
print $image->Border( width => 5, height => 5, fill => $BorderColor );

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

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

# 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...
$image->Annotate(
text => $string,
fill => $TextColor,
x => 15,
y => 30,
pointsize=> 15,
font => $font);


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

print $image->Write($path);
undef $image;

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

}

1;

Cheers

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 6331 Oct 17, 2003, 9:22 AM
Thread Re: [Andy] Image::Magick showing blank images on some server, but not others?
Wil 6187 Oct 17, 2003, 10:10 AM
Thread Re: [Wil] Image::Magick showing blank images on some server, but not others?
Andy 6198 Oct 17, 2003, 10:13 AM
Thread Re: [Andy] Image::Magick showing blank images on some server, but not others?
Andy 6164 Oct 23, 2003, 7:10 AM
Thread Re: [Andy] Image::Magick showing blank images on some server, but not others?
Alex 6135 Oct 23, 2003, 6:45 PM
Thread Re: [Alex] Image::Magick showing blank images on some server, but not others?
Andy 6120 Oct 24, 2003, 7:22 AM
Post Re: [Andy] Image::Magick showing blank images on some server, but not others?
Andy 6051 Oct 28, 2003, 9:33 AM