プロジェクト

全般

プロフィール

Vote #80406

完了

Don't try to generate thumbnails if convert command is not available

Admin Redmine さんが約4年前に追加. 約4年前に更新.

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

0%

予定工数:
category_id:
19
version_id:
127
issue_org_id:
32289
author_id:
332
assigned_to_id:
332
comments:
5
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Currently, Redmine always tries to render attachment thumbnails if the setting "Display attachment thumbnails" is enabled even when ImageMagick's convert command is not available. As a result, users may see broken image icons.

I think such broken things should not be displayed. Redmine should not try to generate thumbnails if the command to create thumbnails is not available.

!{width: 463px; border: 1px solid #ccc;}.broken-image-icon@2x.png!


journals

--------------------------------------------------------------------------------
The following patch will determine if ImageMagick's convert command is available. I attached a patch.

<pre><code class="diff">
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index 8304d4dea..627c1a181 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -201,7 +201,9 @@ class Attachment < ActiveRecord::Base
end

def thumbnailable?
- image? || (is_pdf? && Redmine::Thumbnail.gs_available?)
+ Redmine::Thumbnail.convert_available? && (
+ image? || (is_pdf? && Redmine::Thumbnail.gs_available?)
+ )
end

# Returns the full path the attachment thumbnail, or nil
</code></pre>
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
LGTM. Updated the test name.

Setting the target version to 4.1.0.
--------------------------------------------------------------------------------
Committed the patch.
--------------------------------------------------------------------------------


related_issues

blocks,Closed,32249,Show attachment thumbnails by default

Admin Redmine さんが約4年前に更新

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

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

いいね!0
いいね!0