Bug #15252: IMAGECREATEJPEG CRASHES SERVER
| From: | cboer at pointit dot nl | Date: | Mon, 28 Jan 2002 10:21:32 +0000 |
| Subject: | Bug #15252: IMAGECREATEJPEG CRASHES SERVER | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-78290@lists.php.net to get a copy of this message | ||
From: cboer@pointit.nl
Operating system: WIN2000
PHP version: 4.1.1
PHP Bug Type: GD related
Bug description: IMAGECREATEJPEG CRASHES SERVER
When using jpg picture when PHP says it is corrupt (when it is not) then
Server crashes with function imagecreatefromjpeg.
See source below !
$srcImg = imagecreatefromjpeg($fileName);
$scale = 4;
// create a (blank) smaller image object
$srcSize = getimagesize($fileName);
$dstImg = imagecreate($srcSize[0]/$scale, $srcSize[1]/$scale);
// copy and resize from the source image object to the smaller blank one
imagecopyresized($dstImg, $srcImg, 0, 0, 0, 0,
$srcSize[0]/$scale, $srcSize[1]/$scale,
$srcSize[0], $srcSize[1]);
// send the smaller image object to the browser
$plaatje = imagejpeg($dstImg);
// clean up
imagedestroy($scrImg);
imagedestroy($dstImg);
--
Edit bug report at: http://bugs.php.net/?id=15252&edit=1