Bug #15252 Updated: ImageCreateJPEG() crashes server
| From: | elixer@php.net | Date: | Tue, 29 Jan 2002 03:50:09 +0000 |
| Subject: | Bug #15252 Updated: ImageCreateJPEG() crashes server | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-78415@lists.php.net to get a copy of this message | ||
ID: 15252
Updated by: elixer
Old Summary: IMAGECREATEJPEG CRASHES SERVER
Reported By: cboer@pointit.nl
Status: Open
Bug Type: GD related
Operating System: WIN2000
PHP Version: 4.1.1
New Comment:
Update summary (can't read all caps).
Previous Comments:
------------------------------------------------------------------------
[2002-01-28 05:21:31] cboer@pointit.nl
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 this bug report at http://bugs.php.net/?id=15252&edit=1