3

Django-imagekit, which I'm using to process user uploaded images on a social media website, uses an unacceptably high level of memory. I'm looking for ideas on how to get around this problem.

We are using django-imagekit to copy user uploaded images it into three predefined sizes, and saves the four copies (3 processed plus 1 original) into our AmazonS3 bucket.

This operation is quickly causing us to go over our memory limit on our Heroku dynos. On the django-imagekit github page, I've seen a few suggestions for hacking the library to use less memory.

I see three options:

  1. Try to hack django-imagekit, and deal with the ensuing update problems from using a modified third party library
  2. Use a different imaging processing library
  3. Do something different entirely -- resize the images on in the browser perhaps? Or use a third party service? Or...?

I'm looking for advice on which of these routes to take. In particular, if you are familiar with django-imagekit, or if you know of / are using a different image processing library in a Django app, I'd love to hear your thoughts.

Thanks a lot!

Clay

Chris Dutrow
  • 48,402
  • 65
  • 188
  • 258
Clay Wardell
  • 14,846
  • 13
  • 44
  • 65
  • 2
    FWIW, django-imagekit uses git for version control, so you can simply fork the repo, make changes in the fork and pull from the official repo any time there's an update. You'll still probably end up having to merge a few conflicts here and there, but it makes the process of syncing your changes with official changes extremely easy overall. – Chris Pratt Aug 01 '12 at 17:05

1 Answers1

3

Try to change image size with PIL from console and see if memory usage is ok. Image resize is a simple task, I don't believe you should use side applications. Besides, split your task into 3 tasks(3 images?).