We reached already the PETA bytes. I heard some time ago that Ebay is already calculating their hard disc space in peta byte ( which is 1 000 000 000 000 000 byte ), but the memory limit of a PHP environment is sometimes only 8 Mbyte.
Is this a problem ?
The last days I get more feedback from users that they get a fatal error when they activate NextGEN Gallery or a blank screen when uploading some pictures (which is a fault on my side , that I didn’t do a correct error check). Now lets have a look at nextgen.boelinger.com
A simple WordPress installation and only 1 plugin activated :
And now have a look on alexrabe.de (WordPress plus 22 plugins )
I also calculate the required memory for a 800 x 600 sized jpg, when you want to create a thumbnail : It up to 2,2 MByte in my internal tests… Now go and check you memory_limit 🙂
Due to the fact that most users didn’t understand the behaviour of the PHP GD library. Here an additional test I found on this discussion (taken form http://www.webmasterworld.com/php/3286309.htm ) :
During imagecreatefrom(type) calls, the memory usage is related to the number of pixels in the source image. So, it doesn’t matter if you have 3500×3500 pixels which are all the same color or 3500×3500 pixels of random color noise, the memory allocation will be identical with gd. You can test it by making two JPEGs which are of equal pixel dimensions but dramatically different file sizes then run each through this script.
<?php ini_set('memory_limit', -1); echo 'Start: '.memory_get_usage().' <br />'; $filename = '/path-to-your-file/3500x3500-72.jpg'; $im = imagecreatefromjpeg($filename) or die ("Cannot Initialize new gd image stream"); echo 'ImageCreate: '.memory_get_usage().' <br />'; imagedestroy($im); echo 'ImageDestroy: '.memory_get_usage().' <br />'; ?>
I ran a 72 KB 3500×3500 JPEG and a 904 KB 3500×3500 image and both used up just under 62 MB of memory (61,392,088 bytes to be exact).