mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +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)
 | 
			
		||||
        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()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user