I am developing my project inside Vagrant VM, the software version used is:
- Ubuntu 12.04
- Django 1.6
- Sorl Thumbnail 11.12
- Pillow 2.5.3
I have several images on the path /var/www/django/my_project/media/icons , and I have a model with ImageField pointing to this path.
I also have THUMBNAIL_DEBUG = True in my .py settings
In my template, I use a thumbnail, for example:
{% thumbnail category.image "20" as im %} <img src="{{ im.url }}"></img> {% empty %} {% thumbnail "png/no_image.png" "20" as im %}
There are several objects with the image, and some others without it, and both show only a black square instead of the image.
- Does anyone know why this is happening? I use Sorl-Thumbnail in many projects and have never had this problem.
I tried resetting the full database, I used python manage.py thumbnail clear and python manage.py thumbnail cleanup
I installed: libjpeg62 libjpeg62-dev zlib1g-dev
no_image.png - image (red cross) is not an empty image
- Am I missing a library or dependency?
I got lost, because, as I said, I worked with Sorl-thumbnail in other projects and never saw anything like it.
Any help would be greatly appreciated
Edit
Here are some images I'm trying to display:


(I have pillow png and jpg libraries)
And this is what I see in all cases:

Edit2
The problem with the background. When I upload a png image with a transparent background, Sorl converts the image to jpg and sets the background to black ...
- Is there a way to keep the background transparent or avoid conversion?
- Is it possible to set the background color to white?
I tried:
THUMBNAIL_COLORSPACE = None THUMBNAIL_PRESERVE_FORMAT = True
but does not work