ID:               42656
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jeanpascal dot leandre at free dot fr
-Status:           Open
+Status:           Feedback
 Bug Type:         Reproducible crash
 Operating System: Windows server 2003
 PHP Version:      5.2.4
-Assigned To:      
+Assigned To:      pajoye
 New Comment:

Nothing has been changed in imagecreatefromjpeg. Are you sure it
crashes and it is not a memory_limit (be sure to have error_reporting
and display errors On)?

If yes, please try again with the memory_limit disabled.

However, it looks like a memory limit problem. PHP's memory manager has
been changed since 5.2.0. The reported memory usage is higher than in
5.2.0 (it does not use more but the reports/calculation is more
accurate).

If you still experiment the crash, please provide a link to an image
you used.





Previous Comments:
------------------------------------------------------------------------

[2007-09-13 11:45:19] jeanpascal dot leandre at free dot fr

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 this bug report at http://bugs.php.net/?id=42656&edit=1

Reply via email to