Page 1 of 1

Different textcolor on webserver as on local one

Posted: Sat Sep 20, 2003 8:04 am
by Alyx
I've got programmed a little signature script for DAoC (Dark Age of Camelot) which shall add text on a predefined JPG, which is stored in the script's directory. The text shall be WHITE and on my local Apache server it also is as intended, but if I let the script run on the webserver it's has some purple touch.

Here the relevant code:

Code: Select all

$sig = ImageCreateFromJPeg($fname);

	$namecolor  = ImageColorAllocate($sig,0xFF,0xFF,0xFF);

	function imagestringb($arg1,$arg2,$arg3,$arg4,$arg5,$arg6)
	{
		imagestring ($arg1,$arg2,$arg3,$arg4,$arg5,$arg6);
		imagestring ($arg1,$arg2,$arg3+1,$arg4+1,$arg5,$arg6);
	};	

	imagestringb ($sig, 4, 80,65,  $realmrank, $namecolor);
	imagestringb($sig, 4, 80,80,  dotted($rpatall)." RP gesamt", $namecolor);
	imagestringb($sig, 4, 80,95,  dotted($lastweekrp)." RP letzte Woche", $namecolor);

	header("Content-type: image/png");
	ImagePng($sig);
	ImageDestroy($sig);
	exit;
I've seen some code in which someone first creates a true color image, then loads the JPeg and copies the JPeg into the self created one... which worked on the local server as before, but on the webserver the script didn't work then anymore at all... possibly because of memory limitations of the provider.

Who can help me out, thanks.

Alyx

p.s. The matter that I output it now as PNG is not the reason, as JPG there was the same problem, I just hoped using PNG might help.

p.p.s. The buggy result:
http://www.spacehub.de/sigtest/signatur ... name=Alyci

Posted: Sat Sep 20, 2003 5:08 pm
by Alyx
Hm... really nobody who can help? The provider is the German one purgetec / 1&1 by the way.

Alyx

Posted: Sun Sep 21, 2003 4:35 am
by tylerdurden
Working on it, gimme some time ;-)

You mean the text where it says Silberhand 6L4
1,32 ... gesamt etc??

Seems to be pure white. Photoshop says the same. Did you change something?

Posted: Sun Sep 21, 2003 6:22 am
by pootergeist
take the background JPEG, sling it into your favourite editor and resave it as zero compression truecolour (you may need to raise the number of colours first).

the non white would be because white doesn't appear in the palette of the image you are using as a base - as that palette is mimiced no further indices can be added so the GD process defaults to the closest colour.

I'd advise (once you have your image as a non compressed truecolour jpeg) converting it to either .gd or .gd2 file format and using the native functions.