#23177 [NEW]: imagecreatefromgd2 consumes too much memory
| From: | alberty at neptunelabs dot de | Date: | Sat, 12 Apr 2003 12:59:56 +0000 |
| Subject: | #23177 [NEW]: imagecreatefromgd2 consumes too much memory | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-37596@lists.php.net to get a copy of this message | ||
From: alberty at neptunelabs dot de
Operating system: i686-pc-linux-gnu
PHP version: 4CVS-2003-04-12 (stable)
PHP Bug Type: GD related
Bug description: imagecreatefromgd2 consumes too much memory
Hi,
i've found a bug with handling gd2 images.
The problem is affected with the bundled libgd (2.0.12).
I've convert an image (4932x3543 pixel) with the pngtogd2 tool:
./pngtogd2 mytestpic.png mytestpic.gd2 4932 2
My memory limit is (php.ini):
memory_limit = 162M
The script:
<?php
$filename='mytestpic.gd2';
$image=imagecreatefromgd2($filename);
?>
results an wrong error message:
Fatal error: Allowed memory size of 169869312 bytes exhausted at (null):0
(tried to allocate 22581552 bytes)
At first, 22581552 bytes is only the filesize of the mytestpic.gd2 file.
Also it shouldn be a problem to load an image with 4932x3543 pixel,
because this image need no more
than 69896304 bytes (3+1 channels).
Regards,
Steve
--
Edit bug report at http://bugs.php.net/?id=23177&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=23177&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=23177&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=23177&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=23177&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=23177&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=23177&r=support
Expected behavior: http://bugs.php.net/fix.php?id=23177&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=23177&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=23177&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=23177&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23177&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=23177&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=23177&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=23177&r=gnused