Vote #80697
未完了Warning occurs when displaying a few exceptional PDF thumbnail
0%
説明
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.
--------------------------------------------------------------------------------