プロジェクト

全般

プロフィール

Vote #80697

未完了

Warning occurs when displaying a few exceptional PDF thumbnail

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

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

0%

予定工数:
category_id:
19
version_id:
0
issue_org_id:
33023
author_id:
4
assigned_to_id:
0
comments:
7
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
127
ステータス-->[New]

説明

A PDF thumbnail is displayed, but the following message is output to STDERR.
The PDF file cannot be published, but it was created with a fax image (binary image).

convert.exe: profile 'icc': 'RGB ': RGB color space not permitted on grayscale PNG `redmine_root/tmp/thumbnails/***.thumb' @ warning/png.c/MagickPNGWarningHandler/1668.

The warning disappeared after applying the following patch.


--- a\lib\redmine\thumbnail.rb
+++ b\lib\redmine\thumbnail.rb
@@ -48,7 +48,7 @@
         size_option = "#{size}x#{size}>"
 
         if is_pdf
-          cmd = "#{shell_quote CONVERT_BIN} #{shell_quote "#{source}[0]"} -thumbnail #{shell_quote size_option} #{shell_quote "png:#{target}"}"
+          cmd = "#{shell_quote CONVERT_BIN} #{shell_quote "#{source}[0]"} -thumbnail #{shell_quote size_option} +profile icc #{shell_quote "png:#{target}"}"
         else
           cmd = "#{shell_quote CONVERT_BIN} #{shell_quote source} -auto-orient -thumbnail #{shell_quote size_option} #{shell_quote target}"
         end

Environment:
Redmine 4.1.0
ImageMagick 6.9.10-Q16


journals

Thank you for reporting the issue. Could you provide a sample PDF file that causes the error?
--------------------------------------------------------------------------------
Here is a sample PDF.
--------------------------------------------------------------------------------
Thank you for providing the PDF file but I could not reproduce the issue. A thumbnail was generated without any error.

<pre>
$ convert ~/Downloads/samplePDF.pdf[0] -thumbnail "200x200>" png:test.png
</pre>

<pre>
$ convert -version
Version: ImageMagick 7.0.8-25 Q16 x86_64 2019-01-30 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP
Delegates (built-in): bzlib freetype heic jng jp2 jpeg lcms ltdl lzma png tiff webp xml zlib
</pre>
--------------------------------------------------------------------------------
I tried ImageMagick 7.0.9-24 Q16, but still got the error.
No error occurs when adding the "+profile icc", "-strip" or "-quiet" parameter.

Adding info:
Ghostscript v9.21 or earlier got no errors, however v9.22 or later got errors.
--------------------------------------------------------------------------------
The same error occurs even with the latest Ghostscript ver9.52.
--------------------------------------------------------------------------------
The warning successfully reproduced with ImageMagick 7.0.10-14 and GhostScript 9.52. But is it OK to always remove ICC profile?
--------------------------------------------------------------------------------
Go MAEDA wrote:
> The warning successfully reproduced with ImageMagick 7.0.10-14 and GhostScript 9.52. But is it OK to always remove ICC profile?

I don't know the side effects of adding the option "+profile icc".
I suggest adding the "-quiet" option instead of "+profile icc".
The "-quiet" option has the same effect.
--------------------------------------------------------------------------------

Admin Redmine さんがほぼ2年前に更新

  • カテゴリAttachments_19 にセット

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

いいね!0
いいね!0