php imagecreatefrompng memory limit

1.3k views Asked by At

my memory_limit is set to 90M according to phpinfo() on a 1and1 server but I keep getting errors when using imagecreatefrompng()

Fatal error: Out of memory (allocated 27000832) (tried to allocate 15936 bytes)

2700832 bytes is 25.75MB nowhere near 90 and when I download the image it is only 12 MB

Is there another setting that could be limiting the memory?

1

There are 1 answers

0
maikel On

you can set your memory limit at runtime by calling

    ini_set('memory_limit','128M');

2700832/1024/1024 = 2.575 MB

I guess that imagecreatefrompng needs more memory than the image size.

For comparison I hava an 1.7MB image which needs more than 64MB