1 2 3 4 5 6 7 8 9 10 | from sorl.thumbnail.base import ThumbnailBackend
from os.path import basename
from django.conf import settings
from sorl.thumbnail.helpers import tokey, serialize
class SEOThumbnailBackend(ThumbnailBackend):
def _get_thumbnail_filename(self, source, geometry_string, options):
key = tokey(source.key, geometry_string, serialize(options))
path = '%s/%s/%s' % (key[:2], key[2:4], key)
return '%s%s/%s' % (settings.THUMBNAIL_PREFIX, path, basename(source.name))
|
More like this
- sorl.thumbnail processor: white background by izibi 4 years, 9 months ago
- Letterbox for sorl-thumbnail by Mogga 4 years, 1 month ago
- add port from settings file to an url by sebnapi 11 months ago
- Admin Image Widget by baumer1122 4 years, 9 months ago
- Database file storage by powerfox 4 years, 3 months ago
Comments