mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
thumbnail: Stop applying MAX_EMOJI_GIF_FILE_SIZE_BYTES before resizing.
b14a33c659 attempted to make the 128k limit apply _after_ resizing,
but left this check, which examines the pre-resized image size.
This commit is contained in:
committed by
Tim Abbott
parent
54f2fabac0
commit
544d3df057
@@ -134,13 +134,6 @@ class EmojiTest(ZulipTestCase):
|
||||
with self.assertRaises(BadImageError):
|
||||
resize_emoji(corrupted_img_data, "corrupt.gif")
|
||||
|
||||
def test_resize_too_large_pre_resize(self) -> None:
|
||||
"""An image that is too many bytes pre-resize is an error"""
|
||||
animated_large_img_data = read_test_image_file("animated_large_img.gif")
|
||||
with patch("zerver.lib.thumbnail.MAX_EMOJI_GIF_FILE_SIZE_BYTES", 1024):
|
||||
with self.assertRaises(BadImageError):
|
||||
resize_emoji(animated_large_img_data, "animated_large_img.gif", size=50)
|
||||
|
||||
def test_resize_too_many_pixels(self) -> None:
|
||||
"""An image file with too many pixels is not resized"""
|
||||
with patch("zerver.lib.thumbnail.IMAGE_BOMB_TOTAL_PIXELS", 100):
|
||||
|
||||
Reference in New Issue
Block a user