Feature #38504
openDisplay pasted images in appropriate size on HiDPI displays
0%
Description
The attached patch improves the image paste feature to display images in appropriate size when you use HiDPI displays like Mac's Retina Display.
If you capture a screenshot on a HiDPI display and paste it into Redmine, the image will be displayed at twice the expected size. The image below is an example. Although the expected display size of the image is 400 x 240px, it is actually displayed at 800 x 480px. This is because the image was captured on a HiDPI display and its physical size is 800 x 480px. For me, this problem is really annoying.
After applying the patch, Redmine recognizes the pixel density of the current display when pasting an image and adds an "@2x" or "@3x" suffix to the filename (e.g. clipboard-****@2x.png) depending on the recognized value of the pixel density. With the suffix, pasted images are displayed in an appropriate size. Note that Redmine 3.4.0 and later can recognize suffixes such as "@2x" and "@3x" and adjust the display size of the image (#24922).
I believe this change will improve the UX when using HiDPI displays by resolving the problem that images are displayed at more than twice the size.
Before:
The image in a forum post is displayed twice as large as expected.
After:
The image is displayed at the expected size due to the addition of the "@2x" suffix to the filename when pasting.
Files
Updated by Go MAEDA over 1 year ago
- Target version set to Candidate for next major release
Updated by Go MAEDA over 1 year ago
- Target version changed from Candidate for next major release to 5.1.0
Setting the target version to 5.1.0.
Updated by Go MAEDA 10 months ago
- Target version changed from 6.0.0 to Candidate for next major release
I want to update the patch to specify the width of an image in the markup like GitHub, instead of using the "@2x" trick. This approach allows users to change or remove the width value if necessary.
Textile:!{width: 400px;}.clipboard-202402030959-abcde.png!
CommonMark Markdown:<img src="clipboard-202402030959-abcde.png" width="400">
Deprecated Redcarpet-based Markdown:![](clipboard-202402030959-abcde.png)
(size specifications are not supported)