#24174 [Opn->Fbk]: Seg. fault when calling imagecreatefromstring

2003-06-15 Thread derick
 ID:   24174
 Updated by:   [EMAIL PROTECTED]
 Reported By:  legion at altlinux dot org
-Status:   Open
+Status:   Feedback
 Bug Type: GD related
 Operating System: ALTLinux
 PHP Version:  4.3.2
 New Comment:

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


Previous Comments:


[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



#24174 [Opn->Fbk]: Seg. fault when calling imagecreatefromstring

2003-06-13 Thread sniper
 ID:   24174
 Updated by:   [EMAIL PROTECTED]
 Reported By:  legion at altlinux dot org
-Status:   Open
+Status:   Feedback
 Bug Type: GD related
 Operating System: ALTLinux
 PHP Version:  4.3.2
 New Comment:

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



Previous Comments:


[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