#21533 [Opn->Fbk]: Trouble building PHP w/ GD and including ImageTTFxxx functions

From: Date: Mon, 20 Jan 2003 23:11:23 +0000
Subject: #21533 [Opn->Fbk]: Trouble building PHP w/ GD and including ImageTTFxxx functions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-30734@lists.php.net to get a copy of this message
ID: 21533 Updated by: sniper@php.net Reported By: jeffabruce@hotmail.com -Status: Open +Status: Feedback Bug Type: GD related Operating System: RH 7.2 PHP Version: 4.3.0 New Comment: What was the configure line ? And exactly what freetype 1.x version was installed? And how? Previous Comments: ------------------------------------------------------------------------ [2003-01-20 16:48:08] jeffabruce@hotmail.com I'm really not a Linux developer, and although what you are asking for sounds easy enough, I don't know how to give you what you want. I would like to reiterate that there are 2 issues here: 1. Configure incorrectly reporting my support for FreeType2 2. gd.c has code that given certain #if conditions, leaves the variable 'error' undefined. The crash is occuring because of the reference to this floating pointer. I assume you want a backtrace to determine the line of code that is crashing, but I'm *giving* you the line of code that is crashing. ------------------------------------------------------------------------ [2003-01-09 19:44:35] iliaa@php.net Can you generate a backtrace from the core file and please provide the shortest possible version of the script that can be used to duplicate the crash. ------------------------------------------------------------------------ [2003-01-09 09:24:09] jeffabruce@hotmail.com I am using the bundled GD library. ------------------------------------------------------------------------ [2003-01-08 21:19:00] iliaa@php.net Are you using bundled or non-bundled GD library? ------------------------------------------------------------------------ [2003-01-08 17:52:16] jeffabruce@hotmail.com I had FreeType 1.x installed only, not FreeType 2.x. Problem #1 After extracting the tarball and running 'configure' (with various options), the output indicated that I had FreeType 2 support. Problem #2 So, I built PHP thinking everything was good to go. However, when I tried to use ImageTTFText(), I got a segmentaion fault. Looking at the code in gd.c, I noticed that there is a point in php_imagettftext_common() that looks like: #if HAVE_GD_STRINGFT error = gdImageStringFT(... #elif HAVE_GD_STRINGTTF error = gdImageStringTTF(... #endif ... if ( error ) ... This code is clearly risky at best since variable 'error' is undefined if neither HAVE_GD_STRINGFT or HAVE_GD_STRINGTTF is defined. I solved my issue of not having support for ImageTTFText() by installing FreeType 2.x. But the long term solution should include addressing these 2 issues. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21533&edit=1

« previous php.bugs (#30734) next »