mirror of https://github.com/zulip/zulip.git
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:
parent
14f0594795
commit
b798b34b23
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue