php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14116 imageTTFtext doesnt work with ImageCreateTrueColor
Submitted: 2001-11-19 10:29 UTC Modified: 2001-11-19 12:12 UTC
From: luke at centre dot net dot au Assigned:
Status: Not a bug Package: GD related
PHP Version: 4.0.6 OS: Slackware 8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: luke at centre dot net dot au
New email:
PHP Version: OS:

 

 [2001-11-19 10:29 UTC] luke at centre dot net dot 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-19 10:32 UTC] derick@php.net
Which version of GD/Freetype are you using?

Derick
 [2001-11-19 10:37 UTC] 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:40 UTC] luke at centre dot net dot 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:44 UTC] sander@php.net
Can you post a sample script? You might be doing something wrong...
 [2001-11-19 10:56 UTC] luke at centre dot net dot au
<?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); 
?> 
 [2001-11-19 11:01 UTC] luke at centre dot net dot au
Looks like im getting the same problem to Jeremy BUG-ID 13197.
 [2001-11-19 12:12 UTC] bate@php.net
I say don't use Beta Software.
GD-2.0.1 are beta and buggy. 
It's not a PHP Problem. Use GD-1.8.4.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC