Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

emoji: Add padding around the gif on GIF emoji upload.

akshatdalton52c411df8a74
diff --git a/zerver/lib/upload.py b/zerver/lib/upload.py
index 9ff537eef1c..f7aad3114c4 100644
--- a/zerver/lib/upload.py
+++ b/zerver/lib/upload.py
@@ -159,7 +159,7 @@ def resize_gif(im: GifImageFile, size: int=DEFAULT_EMOJI_SIZE) -> bytes:
im.seek(frame_num)
new_frame = Image.new("RGBA", im.size)
new_frame.paste(im, (0, 0), im.convert("RGBA"))
- new_frame = ImageOps.fit(new_frame, (size, size), Image.ANTIALIAS)
+ new_frame = ImageOps.pad(new_frame, (size, size), Image.ANTIALIAS)
frames.append(new_frame)
duration_info.append(im.info['duration'])
out = io.BytesIO()