mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 20:13:46 +00:00 
			
		
		
		
	emoji: Add padding around the gif on GIF emoji upload.
Replaced ImageOps.fit by ImageOps.pad, in zerver/lib/upload.py, which returns a sized and padded version of the image, expanded to fill the requested aspect ratio and size. Fixes part of #16370.
This commit is contained in:
		| @@ -159,7 +159,7 @@ def resize_gif(im: GifImageFile, size: int=DEFAULT_EMOJI_SIZE) -> bytes: | |||||||
|         im.seek(frame_num) |         im.seek(frame_num) | ||||||
|         new_frame = Image.new("RGBA", im.size) |         new_frame = Image.new("RGBA", im.size) | ||||||
|         new_frame.paste(im, (0, 0), im.convert("RGBA")) |         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) |         frames.append(new_frame) | ||||||
|         duration_info.append(im.info['duration']) |         duration_info.append(im.info['duration']) | ||||||
|     out = io.BytesIO() |     out = io.BytesIO() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user