#23177 [Opn->Bgs]: imagecreatefromgd2 consumes too much memory

From: Date: Tue, 15 Apr 2003 00:47:57 +0000
Subject: #23177 [Opn->Bgs]: imagecreatefromgd2 consumes too much memory
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-37670@lists.php.net to get a copy of this message
ID: 23177 Updated by: iliaa@php.net Reported By: alberty at neptunelabs dot de -Status: Open +Status: Bogus Bug Type: GD related Operating System: i686-pc-linux-gnu PHP Version: 4CVS-2003-04-12 (stable) New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php The memory allocation is: width * height * channels, which in your case would be upwards of 200megs. Previous Comments: ------------------------------------------------------------------------ [2003-04-12 07:59:56] alberty at neptunelabs dot de 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 this bug report at http://bugs.php.net/?id=23177&edit=1

« previous php.bugs (#37670) next »