Downscale pasted retina images
What does this MR do and why?
Downscale pasted retina images
When you paste a higher resolution PNG image into a Markdown text box [in GitLab 17.1 and later](#419913 (closed)), dimensions are always appended. The dimensions are automatically adjusted to accommodate for retina (and other higher-resolution) displays. For instance, a 144ppi image is resized to 50% of its dimensions, whereas a 96ppi image is resized to 75% of its dimensions.
Changelog: added
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Case | Before | After |
---|---|---|
Rich text editor | ||
Plain text editor |
How to set up and validate locally
- Take a screenshot on a retina display.
- Paste in either rich text or plain text editor.
- In plain text editor,
{width=X height=Y}
will be appended where X and Y are real dimensions of the retina image. - In rich text editor, same happens, but the image will be the actual size (50% smaller).
Note: This should also work for uploading files manually using the toolbar, or drag/drop.
Related to #419913 (closed)