Closed wdebusschere closed 8 years ago
memory_limit
is for the RAM. It has nothing to do with file uploads.
You need other configs. Make sure post_max_size is always bigger then upload.
memory_limit = 32M
upload_max_filesize = 24M
post_max_size = 32M
Also, uploads has nothing to with the extension.
If the problem is resizing a 3Mb image, yeah, that has never worked.
Is there solution to resizing a 3MB image?
Buy a server with more RAM or use cloudinary. I also run a server with a 256Mb limit and it can't handle resizing image larger than 1.5Mb. The best thing to do is to set maximum sizes using image_upload.
Ok, image size is the problem 900kb image with width 7000px also gives the error.
If the problem is resizing a 3Mb image, yeah, that has never worked.
Are you sure? JIT 1.x works fine for me with much bigger images. The error message in the issue's title suggests that the script tried to allocate more than 134217728 bytes (as mentioned) — that is a 128 MB memory limit, which should not be reached with a 3MB image.
Ok, I guess that it depends on the physical image size in pixels, i.e. not on the file size?
With 16MB RAM, I can successfully process a 6 Megapixel image. Haven't tested with much bigger images though.
Ok, I guess that it depends on the physical image size in pixels, i.e. not on the file size?
Exactly. All images becomes bitmaps in memory, and we keep the original and the resized version of those bmps in memory. So yeah, a 3Mb image can eat more than 128Mb
Are you sure? JIT 1.x works fine for me with much bigger images.
Yes. Check http://php.net/manual/en/function.imagecreatetruecolor.php
With 16MB RAM,
it all boils down to memory_limit
on a 64Gb server, I still set it to 512M to prevent memory exhaustion.
Now I tried a really big image: 39 Megapixels (file size: 16MB).
php_value memory_limit 256M
— it works php_value memory_limit 16M
— it still worksphp_value memory_limit 8M
— it breaksHow can that be???
Did you turn off the cache before testing ?
And what's the destination size ?
Checking the memory needed before doing the operation would also be wise...
And what's the destination size ?
The destination size in this test was very small, something like 120 Pixels wide.
Unfortuantely I can't test too much on this production system, it's the "big one". (I even took all websites down during the tests by setting the memory size too small, hehe...) I don't have any test/development system at the moment.
very small, something like 120 Pixels wide.
That helps a lot.
Unfortuantely I can't test too much on this production system, it's the "big one"
Stop that! But I am pretty sure you had a cache :P
I love to work on the production system!
I am pretty sure you had a cache
Well, no. The cache gets purged when "something" is saved — which I did. I often break things. But nobody ever complained, because my "dev outages" never last long, which is so much better than elsewhere on the web. :-)
Ahaha!
Well I can't explain it with the fact that your thumbnail is kindof small. Mines are often +600px wide
Nope. I just performed the following extreme test:
php_value memory_limit 256M
It works. :-)
(Admitted: I had to increase the max. execution time.)
Wow this is crazy. Which version of PHP + GD do you run ?
Ubuntu ?
Nope, Debian.
Potato-Tomato ;)
But that's interesting considering that I may implement the test the memory available before doing the operation thingy.
Yes. I have no explanation for your issues (resp. my no-issue).
7f98c78 won't solve this problem, but could reduce the lot on the server. Use with caution.
Uploading image of 3Mb doesn't work anymore.. php.ini: memory_limit = 256 (or -1) doesn't fix it