generate_integration_bots_avatars: Fix transparency initialization.

None results in an uninitialized image (that happens to be transparent
most of the time); we want to explicitly initialize the image to
transparent.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-08-09 15:06:54 -07:00 committed by Tim Abbott
parent 14f0594795
commit b798b34b23
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ def create_square_image(png: bytes) -> bytes:
return png
size = max(img.height, img.width)
new_img = Image.new("RGBA", (size, size), color=None)
new_img = Image.new("RGBA", (size, size), color=(0, 0, 0, 0))
padding = int(abs(img.height - img.width) / 2)
position = (0, padding) if img.height < img.width else (padding, 0)
new_img.paste(img, position)