Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

realm-logo: Scale uploads into the shape they are rendered in.

Sahil Batrabf847f110a7f
diff --git a/web/src/upload_widget.ts b/web/src/upload_widget.ts
index 9b2407cbe40..1243f0567d0 100644
--- a/web/src/upload_widget.ts
+++ b/web/src/upload_widget.ts
@@ -221,7 +221,7 @@ function open_uppy_editor(
} else {
resizing_dimension_opts = {
maxHeight: 100,
- maxWidth: 800,
+ maxWidth: 1000,
};
}
diff --git a/zerver/lib/thumbnail.py b/zerver/lib/thumbnail.py
index a1c7c8d5191..a1b5df36c18 100644
--- a/zerver/lib/thumbnail.py
+++ b/zerver/lib/thumbnail.py
@@ -22,8 +22,10 @@ MEDIUM_AVATAR_SIZE = 500
DEFAULT_EMOJI_SIZE = 64
# Organization logos are scaled down to fit inside these bounds, which
-# are unrelated to the avatar sizes above.
-MAX_REALM_LOGO_WIDTH = 800
+# are unrelated to the avatar sizes above. Their 10:1 shape matches
+# the area the web app renders the logo into, so that logos of every
+# shape keep the same amount of detail on high-density displays.
+MAX_REALM_LOGO_WIDTH = 1000
MAX_REALM_LOGO_HEIGHT = 100
# We refuse to deal with any image whose total pixelcount exceeds
@@ -227,7 +229,7 @@ def resize_logo(image_data: bytes) -> bytes:
# This will only scale the image down, and will resize it to
# preserve aspect ratio and be contained within the maximum logo
# dimensions; it does not add any padding to make it exactly that
- # size. A 1000x10 pixel image will end up as 800x8; a 10x10 will
+ # size. A 2000x10 pixel image will end up as 1000x5; a 10x10 will
# end up 10x10.
# The resizing dimensions should be kept in sync with the client-side
# resizing code in web/upload_widget.ts.