Closed (fixed)
Project:
Drupal core
Version:
4.7.3
Component:
file system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Sep 2006 at 23:18 UTC
Updated:
7 Dec 2006 at 10:47 UTC
whenever I try to submit images (usually larger than 140K, but it's not always true) I get this:
Fatal error: Allowed memory size of 12582912 bytes exhausted (tried to allocate 6400 bytes) in /web/htdocs/www.smartart.it/home/includes/image.inc on line 288
This error seems not strictly related to the image size as stated before.
The temp directory, inside files/images/ holds the files correctly uploaded (of the correct size).
I've opened a forum thread but when I felt like I had no other choice I opened this issue. I hope I can help.
You can find the modules I have enabled in the thread just above.
Regards,
ThePeach
Comments
Comment #1
heine commentedIncrease php's memory_limit, see http://drupal.org/node/76156 in the Troubleshooting FAQ.
Comment #2
killes@www.drop.org commentedComment #3
ThePeach commentedas already stated in other threads the memory limit is already at 12MB, as it can be read from the output error (
12582912 bytes), I tried to set higher values (up to 20MB) viaini_setwith no changes, instead sometimes the exhausted value will be higher that the one reported in the first post. Seems like a loop eating the whole memory... dunno.Comment #4
ThePeach commentedUpdate: the image that causes these problems is THIS (and others if you need more proofs like this jpeg compressed version of the same)
I've tried also to upload it on other drupal powered sites but the result is the same error.
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 6400 bytes) in /var/www/html/xxxxx.it/public_html/htdocs/includes/image.inc on line 288This is not an apache problem.
It seems like moving the image from the temp directory can cause this kind of problems.
Some image info:
and here for the second linked (the jpg)
as you can see I can upload it (used gallery1) and anyway I've also raised upload limits in order to be sure (and -again- it seems not related to image weight).
I don't know if the issue is strictly related to the include file shown in the error (
include/image.incor it is a problem of the image module.Please correct it if necessary.
Comment #5
virgo commentedI think I have exactly the same problem . php_ini is not fixing problems, I increased to 40MB, same thing still happening
Any suggestions ?
Comment #6
ThePeach commented@virgo
I do notice that it seems related to the image size not the weight: I get these problems usually with images larger than 1024px per side. Can you confirm?
The image, as stated before is correctly uploaded into the tmp directory, the error happens when the program tries to resize it and move it to files/images/.
Comment #7
cyrusthevirus commentedPhp use raw images.
A 1000x1000 pixel totally blank image (as a JPG it must be 1 kb or so) uses 3,000,000 bytes or more (1000 x 1000 x 3 colors).
As a rule of thumb, you'll have:
bytes = height x width x 4
The 4 is because the image can have supplemental informations (exif, etc.).
Hint: with getimagesize() you can know the height and the width.
HTH
Comment #8
f5design commentedhas this issue been solved? has it been decided that the issue is a php memory limit issue when dealing with large images?
Just looking for an update or a resolution :)
s
Comment #9
robertdouglass commentedThis is almost certainly a PHP configuration issue. There is nothing special about the image that was linked to above, I was able to upload it to my default 5.0 installation. Make sure that you address the following php.ini variables:
post_max_size
upload_max_filesize
Comment #10
robertdouglass commentedTested on 4.7.4 as well. It isn't a Drupal problem.
Comment #11
(not verified) commented