Resize images on the server

We just implemented a feature in which our users can upload photos. We are updating what the user has uploaded in thumbnail and screen size of 800x600.

The problem we are facing is that this operation seems to take up a lot of memory on our server. We use Django-imagekit for this and there appear to be documented problems with excessive memory usage .

We run django on the Heroku server. In case of these factors, we use postgresql to search for data and search elastics for search.

  • Is there a better library we should use for this?
  • Or is there a completely different strategy for processing user photos on a server that we should consider?

Many thanks!

+5
source share
3 answers

I don’t know what it offers django-imagekit, but you can just use PIL and resize the image to the size you need when saving the loaded image.

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

+2
source

I used and works well PythonMagick , and you can also try wand - this is a ctypes-based ImagedMagick binding library for Python

+2
source

I used gd2 with ruby, which works very well. It is written in C, so it is fast and should not take up much memory. It looks like Python bindings .

+1
source

All Articles