Bug #14116 Updated: imageTTFtext doesnt work with ImageCreateTrueColor

From: Date: Mon, 19 Nov 2001 15:56:22 +0000
Subject: Bug #14116 Updated: imageTTFtext doesnt work with ImageCreateTrueColor
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-70931@lists.php.net to get a copy of this message
ID: 14116 User updated by: luke@centre.net.au Reported By: luke@centre.net.au Old Status: Feedback Status: Open Old Bug Type: *General Issues Bug Type: GD related Operating System: Slackware 8 PHP Version: 4.0.6 New Comment: <?php $fontsize=11; $angle=0; $fontfile="./pub/fonts/ARIAL.TTF"; $image = ImageCreateTrueColor(300, 16); $first=@imagecreatefromPNG("./pub/menuimg/$im1.png"); $white = imageColorAllocate($image, 255, 255, 255); $black = imageColorAllocate($image, 0, 0, 0); imageCopyResized($image,$first,1,0,0,0,ImageSX($first),ImageSY($first),ImageSX($first),ImageSY($first)); imagettftext($image, $fontsize, $angle, 23, 11, $black, $fontfile, "Main Page"); Header( "Content-type: image/png"); imagePNG($image); ImageDestroy ($image); ?> Previous Comments: ------------------------------------------------------------------------ [2001-11-19 10:44:11] sander@php.net Can you post a sample script? You might be doing something wrong... ------------------------------------------------------------------------ [2001-11-19 10:40:33] luke@centre.net.au I am using: GD-2.0.1 FREETYPE-1.3.1 When I use the ImageCreate then the imageTTFtext works, streaming the image to the screen. If I use imageCreateTrueColor then the browse says "document contains no data". ------------------------------------------------------------------------ [2001-11-19 10:37:08] rasmus@php.net Luke, what do you mean by it doesn't work? There is a known problem with anti-aliasing of ttf fonts on truecolor images in gd-2.0.1, but apart from looking rather crappy, it does work. ------------------------------------------------------------------------ [2001-11-19 10:32:57] derick@php.net Which version of GD/Freetype are you using? Derick ------------------------------------------------------------------------ [2001-11-19 10:29:07] luke@centre.net.au For some reason I hanent been able to get imageTTFtext to work with ImageCreateTrueColor. It works fine with ImageCreate but not with the true color. ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=14116&edit=1

« previous php.dev (#70931) next »