From e3a238fc896ecff02ce99daf075d9f131ae61bc1 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Wed, 24 Jul 2024 16:25:02 +0000 Subject: [PATCH] thumbnail: Remove unused thumbnail sizes. 47683144ff switched the web client to prefer the 840x560 size, as the mobile apps prefer; remove the now-unused 300x200 size. No client was using the generated `.jpg` formats, as all clients support `.webp`, so remove the unused `.jpg` thumbnail as well. --- zerver/lib/thumbnail.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/zerver/lib/thumbnail.py b/zerver/lib/thumbnail.py index 928e2fe609..e6d3475899 100644 --- a/zerver/lib/thumbnail.py +++ b/zerver/lib/thumbnail.py @@ -82,15 +82,13 @@ class StoredThumbnailFormat(BaseThumbnailFormat): # options on this list are the ones which are written into # rendered_content. THUMBNAIL_OUTPUT_FORMATS = [ - # For now, we generate relatively large default "thumbnails", so - # that clients that do not understand the thumbnailing protocol - # (e.g. mobile) get something which does not look pixelated. + # We generate relatively large default "thumbnails", so that + # clients that do not understand the thumbnailing protocol + # (e.g. mobile) get something which does not look pixelated. This + # is also useful when the web client lightbox temporarily shows an + # upsized thumbnail while loading the full resolution image. ThumbnailFormat("webp", 840, 560, animated=True), ThumbnailFormat("webp", 840, 560, animated=False), - # 300x200 is the size preferred by the web client. - ThumbnailFormat("webp", 300, 200, animated=True), - ThumbnailFormat("webp", 300, 200, animated=False), - ThumbnailFormat("jpg", 300, 200, animated=False), ]