johnmnemonik / django-photologue

Automatically exported from code.google.com/p/django-photologue
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Memory Error While adding photosize, with pre-cache and an image too large already uploaded #141

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. make sure you only have a few  mb's of memory for your django proces
2. make a few photosizes, with no interesting things. FE: 150x75 crop
false, pre-cache true effect false. Same for 150x150 and 800x0.  
3. add the attached image (this should work)
4. add a new size 425x567, with pre-cache on and crop to fit on.
5. hit save now an error appears: MemoryError 

OR: 
1. create a few photosizes in a normal environment
2. add a few photo's (or the attached photo)
3. cut the amount of memory a user might use to 8mb or something (just
enough to make django run)
4. add a few new sizes with lot's of options
5. an error should appear

What is the expected output? What do you see instead?
It should have saved the photosize, and it should have resized the images.
If a memory error is produced it should catch that and print the filename
which causes the problem. Now I can't find the corrupt file and now I have
set the pre-cache option manually in phpmyadmin, so nothing get's cached
which already has been uploaded.

When I try to upload the attached image with the pre-cache setting set in
phpmyadmin, I get a nice error:
Upload a valid image. The file you uploaded was either not an image or a
corrupted image 
(but the image is not corrupt, it works on my system with lot's of memory).

What version of the product are you using? On what operating system?
latest debian, python 2.5, latest PIL at djangoeurope.org with 60 MB memory.

Please provide any additional information below.

Original issue reported on code.google.com by roeldelt...@gmail.com on 20 Oct 2009 at 11:37

Attachments:

GoogleCodeExporter commented 8 years ago
Additional info to reduce memory per user:
(source:
http://stackoverflow.com/questions/437433/limit-in-the-memory-and-cpu-available-
for-a-user-in-linux)
For process related limits, you can have a look in /etc/security/limits.conf 
(read
the comments in the file, use google or use man limits.conf for more 
information).
And as jpalecek points out, you may use ulimit -a to see (and possibly modify) 
all
such limits currently in effect.

Original comment by roeldelt...@gmail.com on 20 Oct 2009 at 11:40