Search code examples
pythondjangoimage-processingimage-resizingdjango-imagekit

Resizing images on the server


We just implemented a feature where our users can upload photos. We are re-sizing what the user has uploaded into thumbnail and an 800x600 "display" size.

The problem we are having is that this operation seems to be taking up a lot of memory on our server. We are using Django-imagekit to do this and there seems to be documented problems with excessive memory usage.

We are running django on a Heroku server. In case this factors in, we are using postgresql for data and elasticsearch for search as well.

  • Is there a better library that we should be using for this?
  • Or is there a completely different strategy for handling user photos on the server that we should consider?

Thanks so much!


Solution

  • I don't know what django-imagekit offers but you could just use PIL and when saving an upload image resize it to the sizes that you need.

    http://effbot.org/imagingbook/image.htm