/    Sign up×
Community /Pin to ProfileBookmark

ImageCreate/GD module

I have an identical piece of code on 2 different web servers. One is redhat linux and the other is suse linux.There appears to be a problem/discrepancy between how each of these servers responds to a the ImageCreate command.

[CODE]echo”return before = “.$return.”</br>”;$return=ImageCreate($width, $height);echo “return after = “.$return.”</br>”;[/CODE]

is the group of statements.On the redhat server, both the before and after of $return appears.On the suse server, I only get the before result. It’s almost as it doesn’t know what to do with that command.Any assistance is greatly appreciated. I’ve been fighting with this program for most of the week & I think this is my last hurdle. It took some doing, but I think that perhaps GD isn’t installed on the 2nd server. We are using php v 5.0.2 on Linux V4 2.6.5-7.111.19-smp #1 SMP Fri Dec 10 15:10:58 UTC 2004 i686
Looks like SLES (suse) linux with an apache 2.0 handler
The people who set this up are no longer with the company, so we are struggling our way through this. If anyone can be of any advice/assistance in getting this installed, it would be greatly appreciated.
Thanks
D

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@bokehFeb 15.2006 — Can I see the whole thing?
Copy linkTweet thisAlerts:
@moohueyauthorFeb 16.2006 — Here is the expanded code. I get the "return before" results, but never see the "return after" or anything that follows
[CODE]echo "return before= ".$return."</br>";
echo "heigth = ".$height."</br>";
echo "width = ".$width."</br>";
$return=ImageCreate($width, $height);
//Allocate Colours
echo "return after= ".$return."</br>";
$white=ImageColorAllocate($return, 255, 255, 255);
$black=ImageColorAllocate($return, 0, 0, 0);
$green=ImageColorAllocate($return, 0, 255, 0);
$blue=ImageColorAllocate($return, 0, 0, 255);
$yellow=ImageColorAllocate($return, 255, 200, 0);
$red=ImageColorAllocate($return, 255, 0, 0);

ImageFilledRectangle($return, 0, 0, $width, $height, $black);
ImageFilledRectangle($return, 1, 1, $width-2, $height-2, $white);
echo "percent = ". $percent. "</br>";
if ($percent <= 50) { ImageFilledRectangle($return, 1, 2, ($percent/100)*$width, $height-3, $green); }
elseif (($percent > 50) && ($percent <= 75)) { ImageFilledRectangle($return, 1, 2, ($percent/100)*$width, $height-3, $yellow); }
elseif ($percent > 75) { echo "I'm big</br>"; ImageFilledRectangle($return, 1, 2, ($percent/100)*$width, $height-3, $red); }[/CODE]
Copy linkTweet thisAlerts:
@bokehFeb 16.2006 — Well maybe imagecreate() is not supported on that server. Try imagecreatetruecolor() instead.
×

Success!

Help @moohuey spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...