Workaround for issues with old ImageMagick versions


#1

Recently I deployed to Omeka-S 1.2 to my web server. ImageMagick 6.7.2 is installed on the target server.
But the current Thumbnailer implementation requires least version 6.7.5!
So creating thumbnails of uploaded PDF documents failed (see error message below).

 convert: UnrecognizedAlphaChannelType `remove' @ error/convert.c/ConvertImageCommand/657

Remark: Make sure to backup source files, before applying these changes!
As a workaround I adjusted the argument list provided to ImageMagick’s convert command in application/src/File/Thumbnailer/ImageMagick.php. I removed the -alpha remove argument and added -flatten.

'-background white',
'-flatten',
'+repage',
//'-alpha remove',

The -flatten option may be used to remove transparency according to the ImageMagick docs, but it’s not the recommended way.

So maybe this helps to migitate this issue caused by old ImageMagick versions (< 6.7.5).
Just in case versions >= 6.7.5 are not available on your webspace.