mirror of
https://github.com/zulip/zulip.git
synced 2025-10-27 18:13:58 +00:00
slack: Call the correct resize_* function when importing realm icon.
For resizing the icon.png files, we use resize_avatar, not resize_logo. This is pretty confusing - sure, for icons we use the same function as for avatars, but we should have a proper name for the function called in the icon context. So this commit also adds resize_realm_icon, and changes the calls to resize_avatar in icon contexts to resize_realm_icon.
This commit is contained in:
committed by
Tim Abbott
parent
cb6c60ef7a
commit
420849ff6a
@@ -179,6 +179,10 @@ def resize_avatar(image_data: bytes, size: int = DEFAULT_AVATAR_SIZE) -> bytes:
|
||||
).write_to_buffer(".png")
|
||||
|
||||
|
||||
def resize_realm_icon(image_data: bytes) -> bytes:
|
||||
return resize_avatar(image_data)
|
||||
|
||||
|
||||
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 8*AVATAR by AVATAR
|
||||
|
||||
Reference in New Issue
Block a user