Pregunta

Since version 6.7.5, ImageMagick has changed its colorspace from RGB to sRGB. Because of that I also had to change the setting [GFX][colorspace] = sRGB in the configuration of my Typo3 CMS software that makes use of ImageMagick. Everything is working fine again - except thumbnail-creation for PDF-files that now always have a black background (should be white).

It's possible to see all non-black elements of PDF-files (like images etc) on the thumbnails, but all the background that would usually be white is now black. This error only happens for PDF-files. All other image-thumbnails for JPG-, GIF- and PNG-files look as expected (even if they have transparent background).

Does anyone have an idea how I could solve this problem? Is this an ImageMagick-issue or a Typo3-Issue?

¿Fue útil?

Solución

Based on Creating JPG thumbnails from PDF causes problems with new version of ImageMagick I was able to answer this question by myself. If your want to apply this solution to Typo3, the following file changes are needed:

Go to your Typo3 directory and open the file ./t3lib/class.t3lib_stdgraphic.php and replace all appearances of $this->cmds['jpeg'] = '-colorspace ' . $this->colorspace . ' with $this->cmds['jpeg'] = '-colorspace ' . $this->colorspace . ' -flatten

Otros consejos

Use the ImageMagick convert with the "-flatten" option for the background. The actual "PDF" thumbnail conversion is passed to GhostScript as a delegate which means both must be installed on the server correctly. If done correctly which happens in most cases, the path for GhostScript within your coding is not needed if using ImageMagick. The actual PDF encoding can also be a problem. There are shared hosting accounts running 7 year old versions of both ImageMagick and GhostScript with no problem on PDF conversion to thumbnail within the current stable TYPO3 CMS 6.1.1.

A free direct download PDF test file with detailed instructions to solve a "PDF Thumbnail Generation Problem" in TYPO3 CMS is available at Smargasy, Inc. "http://www.smargasy.com/fileadmin/media_data/community/Smargasy_PDF-Thumbnail-Compatibility-Test-File.pdf". The test file helps isolate the problem on systems that use ImageMagick and GhostScript as the image processing and conversion program in a shared hosting environment.

Best Regards

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top