ID: 48179 Updated by: j...@php.net Reported By: ronald dot muller at gmail dot com -Status: Open +Status: Feedback Bug Type: GD related Operating System: * PHP Version: 5.2.9 New Comment:
Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. Previous Comments: ------------------------------------------------------------------------ [2009-05-07 12:45:20] ronald dot muller at gmail dot com Description: ------------ imagecreatefromjpeg() should return FALSE on errors (as documented), not crash - hence aborting the php script. http://www.plasticdaisy.net/dlvs/dlvs.php?c=pr shows "Fatal error: Allowed memory size of 33554432 bytes exhausted" and aborts the script. The crash occurs because memory_limit is exceeded, as mentioned in previous submissions on the same bug. In the example case a 3.8MB jpg is expanded internally to somewhere in between 32MB and 64MB. Increasing the memory_limit does not solve the bug, it merely hides it again. The function should be made according to spec, i.e. return FALSE. Then the php script can act properly on this error. Reproduce code: --------------- ini_set('memory_limit', $TOO_SMALL); $someVar = imagecreatefromjpeg($img); echo $someVar; Expected result: ---------------- return FALSE i.s.o. crash, as documented. Actual result: -------------- Fatal error: Allowed memory size of 33554432 bytes exhausted http://www.plasticdaisy.net/dlvs/dlvs.php?c=pr ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48179&edit=1