mirror of
https://git.linux-kernel.at/oliver/ivatar.git
synced 2025-11-17 21:48:02 +00:00
Address issue #19, inconsistent padding size in relation to requested size + final image return is larger, since padding is added
This commit is contained in:
@@ -110,7 +110,11 @@ class AvatarImageView(TemplateView):
|
||||
'rgb(49,203,115)',
|
||||
'rgb(141,69,170)']
|
||||
background = 'rgb(224,224,224)'
|
||||
padding = (10, 10, 10, 10)
|
||||
padwidth = int(size/10)
|
||||
padding = (padwidth, padwidth, padwidth, padwidth)
|
||||
# Since padding is _added_ around the generated image, we
|
||||
# need to reduce the image size by padding*2 (left/right, top/bottom)
|
||||
size = size - 2*padwidth
|
||||
generator = IdenticonGenerator(
|
||||
10, 10, digest=hashlib.sha1,
|
||||
foreground=foreground, background=background)
|
||||
|
||||
Reference in New Issue
Block a user