1
0
Fork 0
mirror of synced 2024-06-01 10:19:38 +12:00

Fix for dynamic image size.

Added 'canvas_height' this is the size of the header and title space.
This commit is contained in:
MahxieNoodle 2016-10-01 20:50:18 -07:00 committed by GitHub
parent 24ed91e1fe
commit 045c2cf923

View file

@ -10,7 +10,7 @@ tmp_path = "images/banner/tmp"
whitneyMedium = "/usr/share/fonts/whitney-medium.ttf"
whitneyBold = "/usr/share/fonts/whitney-bold.ttf"
header_height = 125
base_height = 245
canvas_height = 145
banner_background = "{}/bannerTop2.png".format(base_path)
banner_bot = "{}/bannerBot.png".format(base_path)
@ -47,7 +47,8 @@ async def create_banner(member, image_title, data):
result_values = list(data.values())
lines_of_text = len(result_keys)
output_file = "{}/banner_{}_{}.jpg".format(tmp_path, member.id, int(datetime.datetime.utcnow().timestamp()))
base_height = canvas_height + (lines_of_text * 20)
# This is the background to the avatar
mask = Image.open('{}/mask.png'.format(base_path)).convert('L')
user_avatar = Image.open(avatar_path)