Bug #17906
closedthumbs.php fails on cmyk images
0%
Description
hi there,
Pointinge &file=abc to a cmyk image makes thumbs.php returns a cmyk thumb. That does not make sense since thumbs.php is mostly used to create images supposed to be displayed within webbrowsers.
And most webbrowser arent able to display CMYK jpgs.
Especially in combination wit DAM this issue is a real showstopper since DAM uses thumbs.php to generate the preview images of the DAM records.
(issue imported from #M6926)
Updated by André Steiling over 16 years ago
Hi folks,
I wrote a quick&dirty "workarround" - or better a proof of concept - for the cmyk images handling, look at thumbs.php, line 238:
$parameters = '-sample '.$this->size.' '.$colors.' '.$this->wrapFileName($this->input.'[0]').' '.$this->wrapFileName($this->output);
- AST Begin: "Patch" imageMagickCommand(): Add profile option if a cmyk image is detected!
// 1. Get colorspace from image: Tested CMYK images return "type: color separated" under T3 4.1.5 & IM 4.2.9
$cmd = t3lib_div::imageMagickCommand('identify', '-verbose '.$this->wrapFileName($this->input.'[0]'));
$arrImg = array();
exec($cmd, $arrImg);
// 2. If CMYK is detected, add profil option
if (trim($arrImg2) == 'type: color separated') {
$profileCMYK = $TYPO3_CONF_VARS['GFX']['im_path'].'USWebCoatedSWOP.icc';
$profileRGB = $TYPO3_CONF_VARS['GFX']['im_path'].'ColorMatchRGB.icc';
$parameters .= ' -profile '.$profileCMYK.' -profile '.$profileRGB;
} - AST End
If you can see, adding profiles solves the problem! But therefore you have to put the needed ICC profiles on your server ... Profiles are aviable under:
http://www.adobe.com/support/downloads/detail.jsp?ftpID=3680
It seems, that there is a problem with the identify -verbose command! If you can bring in a better cmyk detection routine, just feel free!
So, let's discuss and improve the code! ;)
Updated by Andreas Wolf about 13 years ago
- Category set to Image Cropping
- Target version deleted (
0)
Is this still relevant?
Updated by Jigal van Hemert almost 13 years ago
The Adobe profiles you mention do not have a GPL compatible license, so we can not distribute them in TYPO3. There are profiles available at eci.org, but from reports on the web I understand that using profiles only improves the colour rendering slightly.
It seems that adding -colorspace rgb or -colorspace sRGB will at least convert CMYK to RGB. If this has no visible influence on RGB images and produces acceptable results for CMYK images it might be a simple solution.
Updated by Wouter Wolters almost 10 years ago
- Status changed from New to Needs Feedback
- Is Regression set to No
Hi,
as this issue is very old. Is this feature missing in newer versions of TYPO3 CMS (6.2.9)?
Updated by Riccardo De Contardi almost 10 years ago
for CMYK images do you mean for example a .tiff file saved with CMYK color space?
Updated by Oliver Hader over 9 years ago
- Status changed from Needs Feedback to Rejected
- Priority changed from Should have to Could have
Image rendering is (and was) done by external tools like ImageMagick.
TYPO3 does not provide ICC profile conversions, which might get tricky by the way (e.g. CYMK is not just CMYK, there are lots of different profile to be converted from or to).
I'm closing this issue since ICC profile handling is not in the scope of the TYPO3 CMS core.
If somebody needs to do so with the File Abstraction Layer, my extension might be helpful here. It allows to define ICC source (e.g. CYMK coated) and target (e.g. RGBa) color spaces) for a particular file storage:
https://github.com/ohader/fal_profile