sorl-thumbnail

sorl thumbnail + django issues in production

那年仲夏 提交于 2020-01-14 15:09:50
问题 I'm using sorl thumbnail with Django. On my local setup it works fine, but in production the thumbnails are not made. My code looks like this: {% load thumbnail %} {% thumbnail up.image "32x32" crop="center" as im %} <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"> {% empty %} <img src="{{ MEDIA_URL }}/images/missing_small.png" alt="" title="" /> {% endthumbnail %} I enabled logging and the trace looks like this: Traceback (most recent call last): [...] File "/usr

sorl thumbnail + django issues in production

◇◆丶佛笑我妖孽 提交于 2020-01-14 15:05:27
问题 I'm using sorl thumbnail with Django. On my local setup it works fine, but in production the thumbnails are not made. My code looks like this: {% load thumbnail %} {% thumbnail up.image "32x32" crop="center" as im %} <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"> {% empty %} <img src="{{ MEDIA_URL }}/images/missing_small.png" alt="" title="" /> {% endthumbnail %} I enabled logging and the trace looks like this: Traceback (most recent call last): [...] File "/usr

Python Image Library Error - Caught IOError while rendering: not enough data

 ̄綄美尐妖づ 提交于 2020-01-06 15:51:26
问题 I have created a website which is using the sorl-thumbnail to resize the images thats uploaded. Most of the images are getting resized without any issues but for few am getting the following error : Caught IOError while rendering: not enough data Request Method: GET Request URL: http://localhost:8000/user/nash22/photographs/ Django Version: 1.3.1 Exception Type: TemplateSyntaxError Exception Value: Caught IOError while rendering: not enough data Exception Location: /usr/local/lib/python2.7

Django OS X Wrong JPEG library version: library is 80, caller expects 62 sorl.thumbnail

本秂侑毒 提交于 2020-01-01 01:18:13
问题 Im using sorl.thumbnail for django locally on my mac and have been having trouble with PIL, but today i finally managed to get it installed - was some trouble with libjpeg. I can now upload and use images - but I cant resize them using sorl.thumbnail. When i try i get the following error: Wrong JPEG library version: library is 80, caller expects 62 Does anyone know a good solution for this. I dont know wether whatever sorl uses requires an earlier version of libjpeg or wether there is some

sorl-thumbnail multi-page pdfs

北城以北 提交于 2019-12-24 10:01:02
问题 It is possible to use sorl to thumbnail multi-page pdfs? I know you need to use the ImageMagick back end to use pdfs at all. But I am having no success with multi-page pdfs. Looking at the source I think it is because the convert command when it sees multi-page pdfs such as foo.pdf creates a set named foo-1.jpg foo-2.jpg etc... and I don't think sorl expects to see this type of output from 1 file. Is there a way to do this/workaround/patch? 回答1: I needed to solve this myself and made an

fixed window-size in prettyphoto

China☆狼群 提交于 2019-12-24 00:57:38
问题 I'm using prettyphoto for a photo gallery in a django-app. My Images have a maximum height/width (with sorl-thumbnail), but the apect-ratios are different. Because of that, the window of prettyphoto also changes it's apect-ratio and the go-forward/go-back Buttons change positions (they move) everytime it loads the next/previous image. Is there a way to make prettyphoto have a fixed window size? Or add borders to the images so that their format is, for example, square. But I don't want to crop

Thumbnail tag failed: (sorl-thumbnail 11.12)

僤鯓⒐⒋嵵緔 提交于 2019-12-23 03:15:58
问题 I keep getting strange errors from sorl-thumbnail in my production environment (using Sentry as a logger). They all just say Thumbnail tag failed: (which is oh-so-uber-helpful), and they all come from one of three modules. The weird thing is that it doesn't actually affect the site. Pages load fine, and even the thumbnails load fine. It's really only a concern because I'm tired of seeing the errors show up in my list in my Sentry dashboard. However, I can't make heads or tails out of why the

Thumbnail tag failed: (sorl-thumbnail 11.12)

自闭症网瘾萝莉.ら 提交于 2019-12-23 03:15:05
问题 I keep getting strange errors from sorl-thumbnail in my production environment (using Sentry as a logger). They all just say Thumbnail tag failed: (which is oh-so-uber-helpful), and they all come from one of three modules. The weird thing is that it doesn't actually affect the site. Pages load fine, and even the thumbnails load fine. It's really only a concern because I'm tired of seeing the errors show up in my list in my Sentry dashboard. However, I can't make heads or tails out of why the

Why does default_storate.exists() with django-storages with S3Boto backend cause a memory error with a large S3 bucket?

雨燕双飞 提交于 2019-12-21 22:54:19
问题 I am experiencing what looks like a memory leak with django-storages using the S3Boto backend, when running default_storage.exists() I'm following the docs here: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html Here is the relevant part of my settings file: DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' Here is what I do to repeat the issue: ./manage.py shell from django.core.files.storage import default_storage # Check default storage is right default

Image filtering with the new sorl-thumbnail

二次信任 提交于 2019-12-21 06:37:38
问题 I'm trying to upgrade some older websites to the latest version of Django and sorl-thumbnail needs to be updated as well. I have fixed some templates to the new {% thumbnail ... %} {% endthumbnail %} format but I'm having trouble with using both the built-in and custom filters (or processors). I had one for making a thumbnail black & white and a custom written one for setting saturation to 50%. How can I do that with the latest version of sorl-thumbnail? 回答1: It seems that functionality is