Project

General

Profile

Actions

Feature #38504

open

Display pasted images in appropriate size on HiDPI displays

Added by Go MAEDA 11 months ago. Updated about 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Attachments
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

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

Actions #1

Updated by Go MAEDA 11 months ago

  • Description updated (diff)
Actions #2

Updated by Go MAEDA 11 months ago

  • Target version set to Candidate for next major release
Actions #3

Updated by Go MAEDA 11 months ago

  • Target version changed from Candidate for next major release to 5.1.0

Setting the target version to 5.1.0.

Actions #4

Updated by Mitsuyoshi Kawabata 10 months ago

+1

Actions #5

Updated by Go MAEDA 5 months ago

  • Target version changed from 5.1.0 to 6.0.0
Actions #6

Updated by Go MAEDA about 2 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)

Actions

Also available in: Atom PDF