(Django and PIL) encoder error -2 when writing image file

Viewed 1537

I'm new in Django and currently I am working on a my first project. For the thumbnails I'm using sorl-thumbnails, but a strange error piss me off and cannot figure out from where is come from.

That what I try to do is to re-size a image and crop 165x165 with canvas. After that I'm sending the image to the server and save it with PIL. Everything working good in 90% of cases, but some time I receive a error with the following text - "encoder error -2 when writing image file" and "Suspension not allowed here" in the console. The exception is raised on the follow row:

{% thumbnail request.user.artist.get_avatar "50x50" crop="center" as im %}

The strange here is that when I change it from "50x50" to "55x55". Everything start working.

The pictures are always with the same size (165x165). I have checked in the media folder and the image is saved properly. The python version which I use is python 3.3.2 ,the version for Pillow is 2.2.2 and Django 1.6. Аny help would be useful.

Thanks in advance.

2 Answers
Related