|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-09-13 12:03 UTC] pajoye@php.net
[2007-09-21 01:00 UTC] php-bugs at lists dot php dot net
[2008-08-18 12:33 UTC] dhanraj dot r at indianic dot com
[2009-03-01 22:13 UTC] megazzt at gmail dot com
[2009-03-01 22:23 UTC] pajoye@php.net
[2009-03-09 01:00 UTC] php-bugs at lists dot php dot net
[2010-04-14 14:44 UTC] pajoye@php.net
-Status: No Feedback
+Status: Feedback
[2010-04-14 14:44 UTC] pajoye@php.net
[2013-01-08 07:20 UTC] pajoye@php.net
-Status: Feedback
+Status: No Feedback
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 25 08:00:02 2025 UTC |
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