How to avoid serving CMYK to Internet Explorer? How to avoid serving CMYK to Internet Explorer?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

How to avoid serving CMYK to Internet Explorer?

Started by smantscheff, November 11, 2010, 08:14:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

smantscheff

[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&auml;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.


Αndré

Thanks for sharing your experience, but the real solution would be to convert also the full-sized images, right?

smantscheff

No. I want the full-sized images to stay in their original format, be it PSD or TIFF or CMYK/JPG or whatever, because we use coppermine not as a web gallery but as a tool for organizing image data for print as well as for the web.

Regarding TIFF, I just posted a question about it, maybe you can help me there? http://forum.coppermine-gallery.net/index.php/topic,68048.0.html

Αndré

Quote from: smantscheff on November 11, 2010, 08:14:04 PM
How to avoid serving CMYK to Internet Explorer
Quote from: smantscheff on November 12, 2010, 10:24:52 AM
I want the full-sized images to stay in their original format
Depending on the power of your system maybe you could convert full-sized pictures on-the-fly when an IE access that page?


Quote from: smantscheff on November 12, 2010, 10:24:52 AM
Regarding TIFF, I just posted a question about it, maybe you can help me there? http://forum.coppermine-gallery.net/index.php/topic,68048.0.html
Asking here doesn't accelerates my reply. I read every thread sooner or later (depending of my time) and reply if I can help.

smantscheff

The original CMYK files have also to be delivered to IE users. The purpose of our database is to have a single source for print and online material, so it might confuse the users if they see the fullsize (rgb) picture already and still will have to use a separate download link for retrieving the CMYK version.

Αndré