プロジェクト

全般

プロフィール

Vote #78614

完了

Fix thumbnail rendering for images with height >> width

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Attachments_19
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
19
version_id:
132
issue_org_id:
26379
author_id:
302368
assigned_to_id:
1
comments:
10
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
119
ステータス-->[Closed]

説明

The ImageMagick format rule being 100x100> (given 100 as thumbnail size in settings), when uploading images with a height much greater than the width (like websites templates) the thumbnail will have a height of 100px and a computed width so homothety is respected.

In the thumbnail_tag helper from ApplicationHelper, the width attribute is set width Setting.thumbnails_size. I suggest to remove this attribute from the image tag since the source thumbnail has the right size.

Am I missing some cases where this change could have an important impact ?


journals

you can disable imagemagick and then you won't be able to resize thumbnails
<pre>
bundle install --without rmagick
</pre>
--------------------------------------------------------------------------------
Gabriel Cardoso wrote:
> In the `thumbnail_tag` helper from `ApplicationHelper`, the width attribute is set width `Setting.thumbnails_size`. I suggest to remove this attribute from the image tag since the source thumbnail has the right size.

The width attribute is workaround for strange behavior of Firefox. Please see #24927#note-6 and #24927#note-8 for details.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Redmine 3.3 (displayed with 25px * 100px):
!{width: 480px; border: 1px solid #ccc;}.26379-3_3@2x.png!

Redmine 3.4 (displayed with 100px * 392px):
!{width: 480px; border: 1px solid #ccc;}.26379-3_4@2x.png!

--------------------------------------------------------------------------------
Here is a patch to fix this issue.
Thumbnails are displayed in the same way as in Redmine 3.3 if the patch applied.
--------------------------------------------------------------------------------
Waiting for some feedback before merging it.
--------------------------------------------------------------------------------
Perfect ! Thank you !

Indeed, your approach is better and solve the proble. Hope it doesn't break #24927#note-6 and #24927#note-8 on Firefox
--------------------------------------------------------------------------------
Gabriel Cardoso wrote:
> Indeed, your approach is better and solve the proble. Hope it doesn't break #24927#note-6 and #24927#note-8 on Firefox

No problem. Setting both @max-width@ and @max-height@ resolved #24927#note-6.
Thank you for your feedback!

---

"Resolved" status is used by core developers, I am setting the status to "Confirmed".
--------------------------------------------------------------------------------
Patch committed, thanks.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリAttachments_19 にセット
  • 対象バージョン3.4.2_132 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0