Skip to content

Size image and video previews according to realm_media_preview_size setting - #2368

Open
Ruhdee wants to merge 6 commits into
zulip:mainfrom
Ruhdee:issue-2177
Open

Size image and video previews according to realm_media_preview_size setting#2368
Ruhdee wants to merge 6 commits into
zulip:mainfrom
Ruhdee:issue-2177

Conversation

@Ruhdee

@Ruhdee Ruhdee commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Fixes #2177.
Rebased on top of #2355

Screenshots

Small Medium (new) Large (new)
Screenshot_20260716-233951_Zulip Screenshot_20260716-233529_Zulip Screenshot_20260717-155927_Zulip

This PR introduces support for the realm_media_preview_size setting, 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.

@Ruhdee
Ruhdee requested a review from kenclary July 17, 2026 10:52
@Ruhdee Ruhdee added the mentor review GSoC mentor review needed. label Jul 17, 2026
Ruhdee added 6 commits July 20, 2026 13:02
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 kenclary left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, and ready for maintainer review.

@kenclary kenclary assigned Ruhdee and unassigned kenclary Jul 21, 2026
@Ruhdee Ruhdee added maintainer review PR ready for review by Zulip maintainers and removed mentor review GSoC mentor review needed. labels Jul 21, 2026
@Ruhdee
Ruhdee requested a review from rajveermalviya July 21, 2026 20:29
@Ruhdee Ruhdee removed their assignment Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer review PR ready for review by Zulip maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show image/video previews larger according to new setting

3 participants