Storing Sorl-thumbnail created images in separate folder

383 views
Skip to first unread message

Swaroop Shankar V

unread,
Apr 28, 2012, 3:06:12 PM4/28/12
to django...@googlegroups.com
Hello All,
I am using sorl-thumbnail extensively in my project. It works perfectly fine except for one issue which is regarding the storage. The default behaviour of sorl-thumbnail is to create the images in the same folder where the original image is stored. Is it possible to provide a separate location for storage of generated file rather than the source folder? I could find a setting called THUMBNAIL_STORAGE, is it the one to be used? I am not able to figure it out from the documentation. If yes then should i provide the absolute or relative path?

Thanks and Regards,

Swaroop Shankar V

Kelly Nicholes

unread,
Apr 29, 2012, 10:39:17 AM4/29/12
to django...@googlegroups.com
It always just caches the files for me in a completely different directory.

Swaroop Shankar V

unread,
Apr 29, 2012, 12:27:56 PM4/29/12
to django...@googlegroups.com
Thanks Kelly, could you tell me what all settings you had provided for it to cache into a separate directory?

Thanks and Regards,
Swaroop Shankar V



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Tfl7B7Xir_gJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Tiago Almeida

unread,
Apr 30, 2012, 9:57:04 AM4/30/12
to django...@googlegroups.com
Have you tried changing the THUMBNAIL_STORAGE setting? I haven't done what you ask for but you should give it a try.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.

Swaroop Shankar V

unread,
Apr 30, 2012, 3:29:33 PM4/30/12
to django...@googlegroups.com
It looks like the latest version of solr-thumnails or the version that i have currently installed supports THUMBNAIL_STORAGE. When i checked i could see a file under the path solr/thumbnail called defaults.py. In this file there are following options 

DEBUG = False
BASEDIR = ''
SUBDIR = ''
PREFIX = ''
QUALITY = 85
CONVERT = '/usr/bin/convert'
WVPS = '/usr/bin/wvPS'
EXTENSION = 'jpg'
PROCESSORS = (
    'sorl.thumbnail.processors.colorspace',
    'sorl.thumbnail.processors.autocrop',
    'sorl.thumbnail.processors.scale_and_crop',
    'sorl.thumbnail.processors.filters',
)
IMAGEMAGICK_FILE_TYPES = ('eps', 'pdf', 'psd')

which i guess can be overridden from the django settings file. Here there is BASEDIR and SUBDIR and i guess those are the settings to be used but not sure. When i tried to override the default i could see no change. So anyone having experience in setting the same please let me know. 

Thanks and Regards,

Swaroop Shankar V



To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/bh_2yiDPjF0J.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.

Swaroop Shankar V

unread,
Apr 30, 2012, 3:54:52 PM4/30/12
to django...@googlegroups.com
It looks like i was using an old version which came with satchmo. Am currently testing my project with new version. 

Thanks and Regards,
Swaroop Shankar V



Swaroop Shankar V

unread,
Apr 30, 2012, 3:58:54 PM4/30/12
to django...@googlegroups.com
Okay in the latest version every images generated is getting saved to cache. My issue is resolved. Thanks all for your kind help :)

Thanks and Regards,
Swaroop Shankar V



Reply all
Reply to author
Forward
0 new messages