#29398 [NEW]: Unable to allocate memory with big jpeg files

From: Date: Mon, 26 Jul 2004 21:26:39 +0000
Subject: #29398 [NEW]: Unable to allocate memory with big jpeg files
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-63591@lists.php.net to get a copy of this message
From: speps84 at hotmail dot com Operating system: Windows XP PHP version: 5.0.0 PHP Bug Type: GD related Bug description: Unable to allocate memory with big jpeg files Description: ------------ I wrote a script that uses GD to slice big jpeg files (about 50mb, 21600x21600) into small 100x100 jpeg. To make this, I have to open these big files and I use the function imagecreatefromjpeg. While loading (HDD is working), I receive this error: FATAL: emalloc(): Unable to allocate 86400 bytes I have tested different values of memory_limit in php.ini ( and with --enable-memory-limit) even the unlimited value of -1: always the same error. This error happens only with very big jpeg files (37mb and 47mb), not with about 4mb jpeg. Reproduce code: --------------- Launching PHP in Command Line mode under Windows XP: php "myscript.php" --enable-debug --enable-memory-limit The PHP Code is very simple : $img = imagecreatefromjpeg("bigfile.jpg"); Expected result: ---------------- Opening of the image. Actual result: -------------- FATAL: emalloc(): Unable to allocate 86400 bytes -- Edit bug report at http://bugs.php.net/?id=29398&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29398&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29398&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=29398&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29398&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29398&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29398&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29398&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=29398&r=support Expected behavior: http://bugs.php.net/fix.php?id=29398&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=29398&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=29398&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29398&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29398&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29398&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29398&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=29398&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29398&r=float

« previous php.bugs (#63591) next »