matthewwithanm / django-imagekit

Automated image processing for Django. Currently v4.0
http://django-imagekit.rtfd.org/
BSD 3-Clause "New" or "Revised" License
2.27k stars 275 forks source link

Big image with high resolution issue #305

Open hoanghua opened 9 years ago

hoanghua commented 9 years ago

Hi,

I'm facing an issue of django-imagekit crash during thumbnail generation when the input image is too large ( 6000 <-> 9000 px).

I'm using django-imagekit==3.2.5 with Pillow==2.7.0. Django process is killed immediately when we go to a line that can trigger the thumbnail generation. This issue only happens with some big images. The generation works well from small to medium ones.

Please find below the spec that I've used for image resizing. ImageSpecField(source='img', processors=[ResizeToFit(width=230)], format='JPEG',)

Is there something wrong with my setup? Or did I configure something incorrectly? Let me know if you need more details.

matthewwithanm commented 9 years ago

There's nothing I know of in IK that would cause this…I would suggest trying to use the processor directly

ResizeToFit(width=230).process(source_image)

If that also causes the error, you can try performing the operation with PIL/Pillow APIs and see if you experience the same problem.

My hunch is that this is an issue with PIL and not IK specifically.

philippeluickx commented 8 years ago

+1 When running the generateimages command, process gets killed with a 17MB picture.

jfrux commented 7 years ago

+1

maxpoletaev commented 6 years ago

Increasing the memory limit up to 2GB has just helped me.

mpkasp commented 4 years ago

Increasing the memory limit up to 2GB has just helped me.

Are you increasing worker memory on your instance / function? Or is there a way to adjust memory within imagekit?

edit: Thanks for the pro tip, I increased swap on my vm and it's now running. Would have been nice if there was a more friendly error message than "killed"!