Size image and video previews according to realm_media_preview_size setting - #2368
Open
Ruhdee wants to merge 6 commits into
Open
Size image and video previews according to realm_media_preview_size setting#2368Ruhdee wants to merge 6 commits into
realm_media_preview_size setting#2368Ruhdee wants to merge 6 commits into
Conversation
Moves the aspect ratio based rendering code from `InlineImage` to the common `_Image` helper. Both image previews and inline images should be sized dynamically, based on their aspect ratio. See: zulip/zulip#39474
Image preview galleries now have spacing between images, and image previews have a thicker border, matching web. See: https://github.com/zulip/zulip/blob/0e259db4be1f0f089c533944034d1ce9d57c01d5/web/styles/rendered_markdown.css#L569-L571
Inline images now use web-matching padding, and the gray background is removed from them. On web that background is present only on gallery items and image previews, not standalone inline images. See: https://github.com/zulip/zulip/blob/0e259db4be1f0f089c533944034d1ce9d57c01d5/web/styles/rendered_markdown.css#L540-L561
kenclary
approved these changes
Jul 21, 2026
kenclary
left a comment
Collaborator
There was a problem hiding this comment.
This looks good, and ready for maintainer review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2177.
Rebased on top of #2355
Screenshots
This PR introduces support for the
realm_media_preview_sizesetting, which currently has 3 values: small, medium and large. Small corresponds to the earlier size of previews. This setting only affects the max height (and thus max size) of images, so that small images don't get blown up and look blurry.