Unable to get light thumbnails and not work hard with Mac, no errors are generated

I am trying to get thumbnails for sketching using django 1.6.2 on mac (darwin 2.7.5).

Below I will talk about my settings for easy_thumbnails, I also tried with sorl - no debugging was generated for (THUMBNAIL_DEBUG = True). Easy-thumbnails does nothing (without errors, does not write db, does not create a URL). Sorl produces a 400 bad request error, and there is no other debugging.

That's what I'm doing.

#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 "fading contour"

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

Runnng:

python manage.py migrate easy_thumbnails

Go to the 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 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()

. , ? , . , - easy_thumbnails , . - , . , , .

- ?

+4

Source: https://habr.com/ru/post/1530227/


All Articles