diff --git a/.gitignore b/.gitignore index 21e01c4..6a591b3 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ media/item_photos/* media/adminfiles/* media/cache/* +static/photo_uploads/* static/item_photos/* static/adminfiles/* static/cache/* diff --git a/batiskaf/jinja2_ext/thumbnails.py b/batiskaf/jinja2_ext/thumbnails.py index 0576cbb..4a43e1a 100644 --- a/batiskaf/jinja2_ext/thumbnails.py +++ b/batiskaf/jinja2_ext/thumbnails.py @@ -3,5 +3,5 @@ from easy_thumbnails.files import get_thumbnailer def thumbnail(img, size='420x420'): weight, height = size.split('x') - options = {'size': (int(weight), int(height))} + options = {'size': (int(weight), int(height)), 'background': '#fff'} return get_thumbnailer(img).get_thumbnail(options) diff --git a/batiskaf/settings.py b/batiskaf/settings.py index 1f23a62..dab9ff7 100644 --- a/batiskaf/settings.py +++ b/batiskaf/settings.py @@ -237,3 +237,8 @@ if DEBUG: GRAPPELLI_ADMIN_TITLE = 'Батискаф' GRAPPELLI_SWITCH_USER = True GRAPPELLI_CLEAN_INPUT_TYPES = False + +THUMBNAIL_PROCESSORS = ( + 'easy_thumbnails.processors.scale_and_crop', + 'easy_thumbnails.processors.background', +)