[I copied this topic from "cpg1.4 mscellaneous", where I had placed it erroneously.]
I'm using Coppermine for a database of pictures for publication, for the web as well as for print. Therefore users do not only upload RGB pictures but also CMYK. This works fine except for IE 7 (and below) because this [censored] piece of software cannot handle CMYK.
I added the option -colorspace rgb to the arguments of /usr/bin/convert and this works fine for preview images. The full size image remains in CMYK, though, and cannot be displayed in IE.
My question is: Where do I find the code for displaying the full size image? I'd like to add a browser and picture format test to it so that in the pathological case of IE/CMYK a download link to the CMYK image can be displayed instead of the image itself.
--------------------
Meanwhile I found a solution for my problem.
I added some code to include/themes.inc.php (yes I read it that I'm not supposed to do so) which tests an image for CMYK and displays a warning message above the picture if it is displayed in IE. The former is determined on the server, the latter at the client.
Here the (somewhat crude) code.
This function goes somewhere into themes.inc.php:
// If this is a CMYK picture, prepare an invisible error message above the picture.
// The message will be shown using some jquery code only in IE browsers.
function isCMYK($path) {
global $CONFIG;
$cmd = $CONFIG['impath'] . "identify -verbose $path";
if ($output = shell_exec($cmd))
if (strpos( $output, 'Colorspace: CMYK' ))
return true;
return false;
}
And this goes into the function theme_display_fullsize_pic
$fullsize_html .= ' <div id="content">'.$LINEBREAK;
if (isCMYK($imagedata['path'])) {
$fullsize_html .= '<div id="CMYK_warning" style="background-color:#FFD4D4;padding:40px;display:none">
<a name="CMYK_warning_anchor" />
Wenn Ihnen dieses Bild nicht angezeigt wird, kann das daran liegen, dass Sie den Internet Explorer benutzen und dieses Bild in CMYK-Farbkodierung angelegt wurde.
In diesem Fall klicken Sie bitte mit der rechten Maustaste auf <a href="'
. htmlspecialchars($imagedata['path'])
. '">diesen Link</a> und wählen Sie "Ziel speichern unter", um die Bilddatei auf Ihrem Computer zu speichern und weiter zu verarbeiten.
</div>
<script type="text/javascript">
if ($.browser.msie) {
$("div#CMYK_warning").show();
}
</script>
';
}
Now I will have to develop my own theme to avoid conflicts with further updates and remove the messages to the language files, but at least it avoids some irritations with the users.