New design for book-detail template (downloading books etc).
[wolnelektury.git] / apps / sponsors / processors.py
1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 #
5 from PIL import Image, ImageFilter, ImageChops
6
7
8 def add_padding(image, requested_size, opts):
9     if 'pad' in opts:
10         padded_image = Image.new('RGBA', requested_size, '#fff')
11         width, height = image.size
12         requested_width, requested_height = requested_size
13         print 'whatever'
14         padded_image.paste(image, (0, (requested_height - height) / 2))
15         return padded_image
16     return image
17
18 add_padding.valid_options = ('pad',)