mirror of
https://git.linux-kernel.at/oliver/ivatar.git
synced 2025-11-19 14:38:02 +00:00
Make padding better, depending on the size; Fixes #48
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user