php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15252 ImageCreateJPEG() crashes server
Submitted: 2002-01-28 05:21 UTC Modified: 2002-06-09 20:04 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: cboer at pointit dot nl Assigned:
Status: Not a bug Package: GD related
PHP Version: 4.1.1 OS: WIN2000
Private report: No CVE-ID: None
 [2002-01-28 05:21 UTC] cboer at pointit dot 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);

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-28 22:50 UTC] elixer@php.net
Update summary (can't read all caps).
 [2002-06-09 20:04 UTC] edink@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 21:01:30 2025 UTC