2
votes

UPDATE: I turned

DEBUG = True THUMBNAIL_DEBUG = True

In my settings file and an error raised at {% thumbnail image.image "551" as im %}saying OSError at /images/detail/106/maybe/

decoder jpeg not available

I have got sorl in my settings file

INSTALLED_APPS = (
    'account',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'social.apps.django_app.default',
    'images',
    'sorl.thumbnail',


here is my html 
{% load thumbnail %}
{% block title %}{{ user.username }}{% endblock %}
{% block content %}



    <div id="details">
    {% thumbnail image.image "551" as im %}

        <a href="{{ image.image.url }}">
            <img src="{{ im.url }}" alt="{{ image.title }}"class="image-detail">
        </a>

    {% endthumbnail %}

when i Take out the thumbnail tag, <img src="{{ image.image.url }}">, an image displays with no problems.

I was not having this problem while on development stage. but now Im about to deploy and this is happening.

there is no img element to inspect also. Any idea what could have gone wrong??

here is my media url and root.(just incase) MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')

1

1 Answers

0
votes

It has been a while since you asked this question but I stumbled across it trying to solve another Sorl problem.

It seems to me you don't have the correct dependencies installed, the docs have usefu information about this:

You need to have an image library installed. sorl-thumbnail ships with support for Python Imaging Library, pgmagick, ImageMagick (or GraphicsMagick) command line tools. pgmagick are python bindings for GraphicsMagick (Magick++)` ...

Docs: http://sorl-thumbnail.readthedocs.io/en/latest/requirements.html#image-library

TL;DR: You'll probably have do run something like (example from docs for Ubuntu 10.04)

sudo apt-get install libjpeg62 libjpeg62-dev zlib1g-dev
pip install Pillow

On a sidenote: the reason that you don't see an image-tag to inspect is because the {% thumbnail %} tag fails.