Index: lib/class.tx_dam_indexing.php =================================================================== --- lib/class.tx_dam_indexing.php (Revision 48358) +++ lib/class.tx_dam_indexing.php (Arbeitskopie) @@ -1508,6 +1508,29 @@ $meta['fields']['width'] = intval(round($meta['fields']['hpixels']/$meta['fields']['hres']*25.4)); $meta['fields']['height'] = intval(round($meta['fields']['vpixels']/$meta['fields']['vres']*25.4)); } + + // Set correct color_space in base of PhotometricInterpretation + // PhotometricInterpretation: 2 (RGB), 5 (CMYK), CMYK + // @see http://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html + $photometricInterpretation = $metaInfo['fields']['meta']['XMP']['PhotometricInterpretation']; + $photometricInterpretationList = '2,5,CMYK'; + if ($photometricInterpretation + && $meta['fields']['color_space'] + && t3lib_div::inList($photometricInterpretationList, $photometricInterpretation) + && $photometricInterpretation != $meta['fields']['color_space']) { + + switch($photometricInterpretation) { + // RGB + case 2: + $meta['fields']['color_space'] = 'RGB'; + break; + // CMYK + case 5: + case 'CMYK': + $meta['fields']['color_space'] = 'CMYK'; + break; + } + } if ($this->writeDevLog) t3lib_div::devLog('getImageDimensions(): '.$meta['fields']['hpixels'].'x'.$meta['fields']['vpixels'], 'tx_dam_indexing', 0, $meta);