-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sorry but thats not what i'm after. I want to know the available memory
needed to load the image. The default php memory limit is 8M and if the
image is large php is not able to load it because the 8M limit is
reached and therefore causes php to error out.

Is there a way to calculate the memory required to load the image
without haveing to load it? Would the following work...

$memSize = $imageWidth * $imageHeight * 4

This assumes that gd uses 32bits per pixel.

Regards,
        William Bailey.
        Pro-Net Internet Services Ltd.
        http://www.pro-net.co.uk/


Vail, Warren wrote: | actually what you probably need is | | http://www.zend.com/manual/function.getimagesize.php | | Warren Vail | | -----Original Message----- | From: William Bailey [mailto:[EMAIL PROTECTED] | Sent: Wednesday, November 26, 2003 10:01 AM | To: [EMAIL PROTECTED] | Subject: [PHP] Getting the required GD Memmory Usage. | | | Hi All, | | I have a site that loads images with the built in GD functions. Most | of | the images are small and load fine however there are a few images that | are large and when trying to load them causes php to exit with the | unable to allocate memory message. I was wondering if anybody knows of a | way to look at a file (in this case a JPEG) and then calculate the | memory requirements required for GD to load it. | | I know that i can just set the memory limit value to a higher value | but | i don't want to load these large images anyway so if i could work out | the GD memory requirement without having to load the image it would be | most useful. | | -- | Regards, | William Bailey. | Pro-Net Internet Services Ltd. | http://www.pro-net.co.uk/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/xmOQzSfrYDJMXmERAsixAKCoEDRd4JSXHuWvLtXA19zuZiBSJgCeMvJ+
7cp6i4j3YM0n3FVAzMIQFfg=
=CIC2
-----END PGP SIGNATURE-----

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to