ID:               24174
 User updated by:  legion at altlinux dot org
 Reported By:      legion at altlinux dot org
-Status:           Feedback
+Status:           Open
 Bug Type:         GD related
 Operating System: ALTLinux
 PHP Version:      4.3.2
 New Comment:

I did what you asked me. I even got computer for tests. I install last
version s of gd-2.0.15 and php4-STABLE-200306161530. When i use the
bundled GD library everything is ok, but if i use external GD then
happens segfault.


Previous Comments:
------------------------------------------------------------------------

[2003-06-15 16:40:01] [EMAIL PROTECTED]

And if you get the same segfault with --with-gd (ie. the bundled GD),
then provide a GDB backtrace.


------------------------------------------------------------------------

[2003-06-15 14:20:00] [EMAIL PROTECTED]

I would recomment to use the bundled GD library which you can enable by
using --with-gd (without path). Can you try that?

------------------------------------------------------------------------

[2003-06-15 11:57:14] legion at altlinux dot org

This was my configure command:
configure --with-gd=/usr --enable-gd-native-ttf --with-jpeg-dir=/usr
--with-xpm-dir=/usr/X11R6 --with-t1lib --with-ttf=/usr
--with-png-dir=/usr --with-zlib-dir=/usr --with-freetype-dir=/usr 

What is the version libgd do you use ? Maybe this is problem on my
side...

------------------------------------------------------------------------

[2003-06-13 08:36:58] [EMAIL PROTECTED]

And what was the configure line you used to configure PHP?
(note: This does NOT crash for me)


------------------------------------------------------------------------

[2003-06-13 08:33:40] legion at altlinux dot org

Description:
------------
Script segfaults when calling function imagecreatefromstring() with
built-in font. 

PHP version: 4.3.2 (cvs snapshot 20030609)
GD version: 2.0.4


Reproduce code:
---------------
$tmpfilename = tempnam ("/tmp", "FOO");
$im     = imagecreate(200, 100);
$black = imagecolorallocate ($im, 0, 0, 0);
$orange = imagecolorallocate($im, 220, 210, 60);
imagefill($im, 0, 0, $black);
$string = '::: Oops! :::';
imagestring($im, 3, 0, 10, $string, $orange);
imagejpeg($im, $tmpfilename);
imagedestroy($im);
$fp = fopen($tmpfilename, 'r');
while (!feof ($fp)) { $content .= fgets($fp, 4096); }
fclose($fp);
$img = imagecreatefromstring($content);
// following function will be work
// $img = imagecreatefromjpeg($tmpfilename);

header ("Content-type: image/jpeg");
imagejpeg($img);
imagedestroy($img);
unlink($tmpfilename);

Expected result:
----------------
Must be generate jpeg image. 

Actual result:
--------------
Segmentation fault


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24174&edit=1

Reply via email to