Page 1 of 1

Problem with image created with GD

Posted: Wed May 03, 2006 2:39 am
by webstyler
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi to all 

We have a script that create a "button" image with gd
This script use our ttf upload online, in script dir

All work great ok for 1 year, now the image created is bad.
Seems they have antialiasing but this is set 0

Correct Image:[url]http://www.webstyler.it/public/ok.gif[/url] 
Bad Image:[url]http://www.webstyler.it/public/ko.gif[/url]

Script is really simpe:

Code: Select all

//================================================
$im = ImageCreateFromGif('base.gif');
$color = ImageColorAllocate($im,255,255,255);
imagettftext($im, 8.5, 0, 14, 13, -$color, "asimo.ttf", $_POST['name']);
$file_pulsante="$dirsharefile/".$pulsante.".gif";
Imagegif($im,$file_pulsante);
ImageDestroy($im);
//================================================


Thks :)


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Thu May 18, 2006 2:36 am
by webstyler
:'(

we have try all but not solutions founded

help pls

ps. sorry x bad syntax on my prev post :)

Posted: Thu May 18, 2006 3:14 am
by onion2k
Moved to PHPGD.com forum.

Posted: Thu May 18, 2006 3:19 am
by webstyler
thks

Posted: Thu May 18, 2006 3:19 am
by onion2k
Firstly, what is -$color supposed to do? I can't see a reason for the -.

Secondly, are you switching antialiasing off? You're not using the imageantialias() function at all..

Thirdly, has anyone changed GD at all? In particular, have they upgraded the freetype library to enable font hinting? I think the problem is that the font you're using is actually supposed to look like the "bad" gif, but until now GD hasn't been using it's hinting values so it's looked like the old gif. (Bit of a guess there though..)

Posted: Thu May 18, 2006 3:42 am
by webstyler
onion2k wrote:Firstly, what is -$color supposed to do? I can't see a reason for the -.
http://www.php.net/manual/en/function.imagettftext.php
"Using the negative of a color index has the effect of turning off antialiasing"
onion2k wrote: Secondly, are you switching antialiasing off? You're not using the imageantialias() function at all..
..uhm
I've used - on imagegetftext
but I can try to add imageantialias
onion2k wrote:
Thirdly, has anyone changed GD at all? In particular, have they upgraded the freetype library to enable font hinting? I think the problem is that the font you're using is actually supposed to look like the "bad" gif, but until now GD hasn't been using it's hinting values so it's looked like the old gif. (Bit of a guess there though..)
Gd is the same versione, php is been upgraded
how can I check if hosting service have upgraded the freetype library to enable font hinting ?

thks