#21729 [Opn->Fbk]: imagettftext don't work with a image copied resized from another

From: Date: Tue, 21 Jan 2003 03:06:26 +0000
Subject: #21729 [Opn->Fbk]: imagettftext don't work with a image copied resized from another
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-30765@lists.php.net to get a copy of this message
ID: 21729 Updated by: sniper@php.net Reported By: paolo@i-dome.com -Status: Open +Status: Feedback Bug Type: GD related Operating System: Linux PHP Version: 4.3.0 Previous Comments: ------------------------------------------------------------------------ [2003-01-20 19:22:48] pajoye@php.net Hello, Can you provide a small script to reproduce your problem, this function works like a charm here. This line: $tc = ImageColorAllocate ($im, $colors[$color][0], $colors[$color][1], $colors[$color][2]); can be your problem. Check the $color array, or set error_reporting(E_ALL); to see if they are initialized correctly (btw, use always this flag to develop). Second point, ImageAlphaBlending is useless in your case, ImageColorAllocate allocates a color with an opaque alpha channel. thank's for your interest, pierre ------------------------------------------------------------------------ [2003-01-19 07:27:08] paolo@i-dome.com Don't show the text also with the latest CVS version. ------------------------------------------------------------------------ [2003-01-18 13:17:24] iliaa@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip ------------------------------------------------------------------------ [2003-01-18 11:17:51] paolo@i-dome.com This code work fine on PHP 4.2.3 compiled with gd2.0.4, but give a image without text with php 4.3 compiled with internal gd support. I have this problem only in the image resized and not with the original image: if($width==$isize[0]) //original size: this work { $im = ImageCreateFromPNG ("bottoni/".$tipo_bottone); } else // to resize: don't work { $im1 = ImageCreateFromPNG("bottoni/".$tipo_bottone); $im=ImageCreateTrueColor($width, $isize[1]); ImageCopy($im, im1,0,0,0,0,$margin_width,$isize[1]); ImageCopyResized($im, $im1, $margin_width, 0, $margin_width, 0, $width, $isize[1], round($isize[0]-($margin_width * 2),0), $isize[1]); ImageCopy($im, $im1,$margin_width+$width-1,0,$isize[0]-$margin_width,0,$margin_width,$isize[1]); ImageDestroy($im1); } ImageAlphaBlending($im, true); $tc = ImageColorAllocate ($im, $colors[$color][0], $colors[$color][1], $colors[$color][2]); imagettftext($im, $size, 0, $center, $margin_height, $tc, $currpath."/fonts/".$font,$testo); ImageAlphaBlending($im, false); header("Content-Type: image/png\n\n"); ImagePNG($im); Thank for support Paolo Morandi ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21729&edit=1

« previous php.bugs (#30765) next »