4

I'm trying to get easy-thumbnails to generate thumbnails using django 1.6.2 on a mac (darwin 2.7.5).

I'll detail below my settings for easy_thumbnails, I have also tried with sorl - no debug was generated for either (THUMBNAIL_DEBUG = True). Easy-thumbnails does nothing (no error, doesn't write to db, produces no url). Sorl produces a bad request 400 error, and there is no other debug to go on.

Here's what I do.

#settings.py
THUMBNAIL_DEBUG = True  
INSTALLED_APPS = ('easy_thumbnails',)
THUMBNAIL_ALIASES = {
'': {
    '40x40': {'size': (40, 40), 'crop': True}, 
    '100x100': {'size': (100, 100), 'crop': True},
    '250x250': {'size': (250, 250), 'crop': True},
},
}

#after pip install pillow
--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- LIBTIFF support available
--- FREETYPE2 support available
*** LITTLECMS2 support not available
--- WEBP support available
--- WEBPMUX support available

From 'pip freeze'

Django==1.6.2
Pillow==2.3.0
easy-thumbnails==1.5

Runnng:

python manage.py migrate easy_thumbnails

Go to template and try the following:

#template
{% load thumbnail %}
<img src="{{ request.user.picture|thumbnail_url:'250x250' }}" alt="" />
<!-- without thumbnail, pic is visible here -->
<img class="profile_pic" src="{{ request.user.picture }}" alt="" />

Result:

Nothing and no errors!

Edit: I should also add i did the following:

$ ./manage.py shell
>>> from easy_thumbnails.files import get_thumbnailer
>>> opts = {'size': (966, 300), 'replace_alpha': '#fff', 'autocrop': True, 'crop': True, 'upscale': True}
>>> get_thumbnailer(open('your_image.png'), 'put.png').generate_thumbnail(opts).image.show()

And there were no errors. I assume the problem is elsewhere and nothing to do with pillow? I'm at a complete loss as to what is causing this. I know, at some point, easy_thumbnails was working as i had data in the database. Something has clearly broken it but without any debug I'm a at a bit of a loss to know where to go next.

Can anyone help please?

rix
  • 10,104
  • 14
  • 65
  • 92
  • That may seem trivial but are you sure request.user is not anonymous? – Łukasz Staniszewski Mar 05 '14 at 12:02
  • 1
    Try enabling THUMBNAIL_DEBUG to see the traceback of the error, by default is errors are silent – Mario César Mar 31 '14 at 06:32
  • Sorry i can't remember how i solved it but of course it was not a problem with either sorl or thumbnails. I suggest you try using django shell to thumbnail and see if that works. – rix Jan 02 '15 at 19:39

0 Answers0