mirror of https://github.com/zulip/zulip.git
realm_emoji: Don't accept animated realm emoji with unequal dimensions.
Fixes: #3654.
This commit is contained in:
parent
4321f1f2b4
commit
5a5072730c
|
@ -107,7 +107,10 @@ def resize_emoji(image_data, size=DEFAULT_EMOJI_SIZE):
|
|||
im = Image.open(io.BytesIO(image_data))
|
||||
image_format = im.format
|
||||
if image_format == 'GIF' and im.is_animated:
|
||||
if im.size[0] > size or im.size[1] > size:
|
||||
if im.size[0] != im.size[1]:
|
||||
raise JsonableError(
|
||||
_("Animated emoji must be have same width and height."))
|
||||
elif im.size[0] > size:
|
||||
raise JsonableError(
|
||||
_("Animated emoji can't be larger than 64px in width or height."))
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue