Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: How to avoid serving CMYK to Internet Explorer?  (Read 4642 times)

0 Members and 1 Guest are viewing this topic.

smantscheff

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
How to avoid serving CMYK to Internet Explorer?
« on: November 11, 2010, 08:14:04 pm »

[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:
Code: [Select]
// 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
Code: [Select]
        $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.

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: How to avoid serving CMYK to Internet Explorer?
« Reply #1 on: November 12, 2010, 10:06:26 am »

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

smantscheff

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: How to avoid serving CMYK to Internet Explorer?
« Reply #2 on: November 12, 2010, 10:24:52 am »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: How to avoid serving CMYK to Internet Explorer?
« Reply #3 on: November 12, 2010, 11:10:17 am »

How to avoid serving CMYK to Internet Explorer
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?


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.
Logged

smantscheff

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: How to avoid serving CMYK to Internet Explorer?
« Reply #4 on: November 12, 2010, 11:32:23 am »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: How to avoid serving CMYK to Internet Explorer?
« Reply #5 on: November 12, 2010, 11:44:24 am »

Okay, then
Thanks for sharing your experience
:)
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.