Currently the commands defined here only converts the first layer of multilayered pictures.
This is probably due to the fact most pictures contain a flattened version on the layer 0.
It seems some files have an incompatible layer 0 with the -flatten options and thus only a part of the picture is converted (see attached compressed psd file), the background color is applied.
Workaround: instead of using the default
<command name="jpegResizer" enabled="true"> <commandLine>convert</commandLine> <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -background white -flatten -depth #{targetDepth} #{inputFilePath}[0] jpg:- | convert - -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</parameterString> <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -background white -flatten -depth #{targetDepth} #{inputFilePath}[0] -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</winParameterString> <installationDirective>You need to install ImageMagick.</installationDirective> </command>
One could use the following:
<command name="jpegResizer" enabled="true"> <commandLine>convert</commandLine> <parameterString>-layers merge -define registry:temporary-path=#{java.io.tmpdir} -quiet -background white -flatten -depth #{targetDepth} #{inputFilePath} jpg:- | convert - -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</parameterString> <winParameterString>-layers merge -define registry:temporary-path=#{java.io.tmpdir} -quiet -background white -flatten -depth #{targetDepth} #{inputFilePath} -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</winParameterString> <installationDirective>You need to install ImageMagick.</installationDirective> </command>
This results in proper generation of thumbnails and preview for example at the expense of added computing but should work with any multilayered file.