Make padding better, depending on the size; Fixes #48

This commit is contained in:
Oliver Falk
2019-02-20 19:25:39 +01:00
parent 8060b91b0b
commit 154ed0c4f9

View File

@@ -157,6 +157,10 @@ class AvatarImageView(TemplateView):
'rgb(141,69,170)']
background = 'rgb(224,224,224)'
padwidth = int(size/10)
if padwidth < 10:
padwidth = 10
if size < 60:
padwidth = 0
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)