Dodanie omyłkowo pominiętego API.
[wolnelektury.git] / apps / sponsors / processors.py
1 from PIL import Image, ImageFilter, ImageChops
2
3
4 def add_padding(image, requested_size, opts):
5     if 'pad' in opts:
6         padded_image = Image.new('RGBA', requested_size, '#fff')
7         width, height = image.size
8         requested_width, requested_height = requested_size
9         print 'whatever'
10         padded_image.paste(image, (0, (requested_height - height) / 2))
11         return padded_image
12     return image
13
14 add_padding.valid_options = ('pad',)