From: jeanpascal dot leandre at free dot fr Operating system: Windows server 2003 PHP version: 5.2.4 PHP Bug Type: Reproducible crash Bug description: crash imagecreatefromjpeg specific php 5.2.4
Description: ------------ Imagecreatefromjpeg crash with large-sized pictures (ex 2 Megapixel 500KB) since php version 5.2.1. The probleme exists width php 5.2.3, 5.2.4 there, but did not exist php 5.2.0 there. The increase of memory allowed for php scripts do not solve the problem. If 8M memory is enough for a picture of 6 Megapixel width php 5.2.0, even 32M of memory is not enough for PHP 5.2.4 , because memory occupation of the server becomes then very very important(my server has only 2 GB DDR) The problem declared itself during the upgrade 5.2.1. It is thus necessary to see what took place during the programming of 5.2.1 Reproduce code: --------------- $conf = $_GET["conf"]; $fichier = $_GET["fichier"] ; include("sys/".$conf.".php"); $image = ImageCreateFromJPEG($fichier) ; $width = imagesx($image) ; $height = imagesy($image) ; $ratio = $width / $height ; $new_width = $widthThumb ; $new_height = $widthThumb / $ratio ; if ($new_height > $heightThumb) { $new_height = $heightThumb ; $new_width = $heightThumb * $ratio ; } $thumb = imagecreatetruecolor($new_width,$new_height) ; imagecopyresampled($thumb,$image,0,0,0,0,$new_width,$new_height,$width,$height) ; header("Content-type:image/jpeg") ; imagejpeg($thumb) ; imagedestroy($image) ; imagedestroy($thumb) ; Expected result: ---------------- This script work normally with the large-sized pictures of several megapixels from the new digital cameras Actual result: -------------- crash with large-sized pictures -- Edit bug report at http://bugs.php.net/?id=42656&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42656&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42656&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42656&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42656&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42656&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42656&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42656&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42656&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42656&r=support Expected behavior: http://bugs.php.net/fix.php?id=42656&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42656&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42656&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42656&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42656&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42656&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42656&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42656&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42656&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42656&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42656&r=mysqlcfg