Questions tagged [sorl-thumbnail]

Thumbnails for Django

Documentation: http://sorl-thumbnail.rtfd.org/

Code: https://github.com/mariocesar/sorl-thumbnail

User support: https://stackoverflow.com/questions/tagged/sorl-thumbnail

Bugs and new features: https://github.com/mariocesar/sorl-thumbnail/issues

Features at a glance

  • Support for Django 1.11, 2.2 and 3.0 following the Django supported versions policy
  • Python 3 support
  • Storage support
  • Pluggable Engine support for Pillow, ImageMagick, PIL, Wand, pgmagick, and vipsthumbnail
  • Pluggable Key Value Store support (cached db, redis, and dynamodb by AWS)
  • Pluggable Backend support
  • Admin integration with possibility to delete
  • Dummy generation (placeholders)
  • Flexible, simple syntax, generates no html
  • ImageField for model that deletes thumbnails
  • CSS style cropping options
  • Back smart cropping, and remove borders from the images when cropping
  • Margin calculation for vertical positioning
  • Alternative resolutions versions of a thumbnail
246 questions
25
votes
3 answers

Storing images and thumbnails on s3 in django

I'm trying to get my images thumbnailed and stored on s3 using django-storages, boto, and sorl-thumbnail. I have it working, but it's very slow, even with small images. I don't mind it being slow when I save the form and upload the images to s3, but…
asciitaxi
  • 1,369
  • 1
  • 16
  • 16
20
votes
4 answers

Table thumbnail_kvstore doesn't exist

I can't get the thumbnail displayed in my template. I get this error: django.db.utils.ProgrammingError: (1146, "Table 'ia_website.thumbnail_kvstore' doesn't exist") Installed sorl_thumbnail-12.3 I'm using MariaDB 10.1.11 I have no migration that…
Marc
  • 1,340
  • 2
  • 14
  • 23
17
votes
2 answers

Django easy-thumbnails vs sorl-thumbnail differences

I've been reading about and trying various thumbnailing apps for Django. These are the requirements: All generated thumbnails must be saved in a S3 bucket separate from the original images, i.e. separate storage class When the image instance is…
davidtgq
  • 3,780
  • 10
  • 43
  • 80
13
votes
4 answers

Django: sorl-thumbnail and easy-thumbnail in same project

I'm working on and project that uses two separate modular Django apps. However, one app requires easy-thumbnails and the other requires sorl-thumbnails. Unfortunately, the two thumbnail libraries make use of the template tag syntax {% load…
Joe J
  • 9,985
  • 16
  • 68
  • 100
13
votes
4 answers

Django + S3 (boto) + Sorl Thumbnail: Suggestions for optimisation

I am using S3 storage backend across a Django site I am developing, both to reduce load from the EC2 server(s), and to allow multiple webservers (redundancy, load balancing) access the same set of uploaded media. Sorl.thumbnail (v11) template tags…
Matt Austin
  • 2,613
  • 1
  • 27
  • 32
13
votes
6 answers

django-storages + sorl_thumbnail + S3 not working well together (URLs mismatch)

I am using django-storages and sorl_thumbnail together and I am using Amazon S3 for static and media files. I am using one bucket with 2 folders, 1 for static and 1 for media. Here is my config: MEDIA_ROOT = '/media/' MEDIA_URL =…
e-Jah
  • 335
  • 4
  • 16
12
votes
5 answers

How to thumbnail static files?

I want to resize my static files with sorl thumbnail but it doesnt work here is my codes {% if not new.photo %} {% with path="{{STATIC_URL}}/images/empty-news.jpg" %} {% thumbnail path "80x80" crop="center" as im %}
aysekucuk
  • 461
  • 5
  • 16
11
votes
1 answer

django - Things to know about sorl-thumbnail

I am using sorl-thumbnail to create thumbnails for my project. I am implementing it only in templates and not in the models or the view. And each of the thumbnail are linked with their original image, which are used by a lightbox. As a newbie, I…
Aamu
  • 3,431
  • 7
  • 39
  • 61
11
votes
2 answers

override save method - 'ImageFile' object has no attribute '_committed'

I override the save method like below, and get_thumbnails and save with sorl.. But get the error 'ImageFile' object has no attribute '_committed' class HotelPhotos(models.Model): hotel = models.ForeignKey(Hotel, related_name='photos') code =…
tuna
  • 6,211
  • 11
  • 43
  • 63
11
votes
1 answer

Wrong url with Django Sorl thumbnail with Amazon s3

I am having a very strange error in using sorl thumbnails in my django project which uses S3 for media files. I have done my settings as pointed out in this answer https://stackoverflow.com/a/12848650/538191 and in fact all my other media files are…
Sachin
  • 3,672
  • 9
  • 55
  • 96
11
votes
3 answers

Pointers on using celery with sorl-thumbnails with remote storages?

I'm surprised I don't see anything but "use celery" when searching for how to use celery tasks with sorl-thumbnails and S3. The problem: using remote storages causes massive delays when generating thumbnails (think 100s+ for a page with many…
Yuji 'Tomita' Tomita
  • 115,817
  • 29
  • 282
  • 245
10
votes
4 answers

How to resize source with sorl-thumbnail?

I was searching the web for my question and couldn't find a clear answeror any example. Basically, I want to use sorl and want to resize the source image during the Model save time to resize it down to 640x480 size, so that I don't end-up storing…
user1039384
  • 521
  • 7
  • 16
9
votes
4 answers

sorl-thumbnail not working

I have been trying for several hours now to get sorl-thumbnail working, but it just won't work. The hard part is that it's not showing errors so I have no idea whats wrong. I followed the instructions to install it. My full code can be found here:…
Sam Stoelinga
  • 4,881
  • 7
  • 39
  • 54
8
votes
4 answers

Sorl thumbnail not showing thumb in AdminImageMixin

I'm having trouble with Django 1.3 using django-grappeli and sorl-thumbnail. I have a project that uses this code from the official sorl-thumbnails docs: # myapp/admin.py from django.contrib import admin from myapp.models import MyModel from…
rsavu
  • 601
  • 1
  • 7
  • 11
8
votes
2 answers

Sorl-thumbnail generates black square instead of image

I'm developing my project inside a Vagrant VM, the software version I'm using is: Ubuntu 12.04 Django 1.6 Sorl Thumbnail 11.12 Pillow 2.5.3 I have some pictures in the path /var/www/django/my_project/media/icons and I have a model with an…
AlvaroAV
  • 10,335
  • 12
  • 60
  • 91
1
2 3
16 17