Project

General

Profile

Actions

Defect #33023

open

Warning occurs when displaying a few exceptional PDF thumbnail

Added by Anonymous almost 5 years ago. Updated over 4 years ago.

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

0%

Estimated time:
Resolution:
Affected version:

Description

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


Files

samplePDF.pdf (15.5 KB) samplePDF.pdf Anonymous, 2020-02-20 01:43
Actions

Also available in: Atom PDF