Bug 105006 - preview of cmyk jpeg is shown inverted
Summary: preview of cmyk jpeg is shown inverted
Status: RESOLVED WORKSFORME
Alias: None
Product: kfile-plugins
Classification: Applications
Component: jpeg (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Carsten Pfeiffer
URL:
Keywords:
: 123604 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-05-03 10:46 UTC by rgpublic
Modified: 2013-05-07 23:46 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Snapshot of Konq with wrong colors (188.20 KB, image/jpeg)
2005-05-09 18:24 UTC, rgpublic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rgpublic 2005-05-03 10:46:47 UTC
Version:            (using KDE KDE 3.4.0)
Installed from:    SuSE RPMs

All CMYK images are shown inverted in Konqueror preview.
Not that I would expect to use color profiles just for preview but
a simple
R=1-C
G=1-M
B=1-Y
should be much better than the status quo ;-)
Comment 1 Brad Hards 2005-05-04 13:16:19 UTC
Can you please attach an example (or a link to an example) which shows this problem?
Comment 2 rgpublic 2005-05-04 18:21:35 UTC
Sure:
http://www.locus-caementitium.de/download/lcf_galerie.jpg

But any CMYK jpeg is in fact shown inverted.
Just search for jpeg and cmyk on Google and you will find tons
of images.
The reason why this doesnt work, I suppose, is because CMY
is mathematically the inversion of RGB (see my original post).
I forgot: "K" is added to C,M and Y.
In reality, though, it's not quite as easy and only the use of
color profiles gives really good results. Ask either the open
source teams of Scribus or Krita about littlecms. They should
know about this and already have GPL'd routines that do this
correctly. For now (and that's what this bug is about) I would
be more than happy if such images are at least negated to show 
somewhat decent colors. The problem is not on the web but rather
when using the Konqueror preview to browse professional Image CDs 
and Photo Libraries. They are often in CMYK so it's a bit hard to
find images if all of them are negated.
Comment 3 Brad Hards 2005-05-08 14:16:05 UTC
In that example, what colour is the cushioning on the seat in the foreground? That is, what do you see in preview (thumbnail) mode?

If it is not red, can you tell me what your libqt-mt.so is linked to (using ldd on whereever it is located)?
Comment 4 rgpublic 2005-05-09 18:24:17 UTC
Created attachment 10965 [details]
Snapshot of Konq with wrong colors
Comment 5 rgpublic 2005-05-09 18:30:39 UTC
The color as you can see on the screenshot is blue/purple.
Further info (I'm using SuSE 9.2, KDE installed by SuSE RPMs):

> rpm -q qt3
qt3-3.3.4-3

> rpm -ql qt3 | grep libqt
/usr/lib/libqt-mt.so.3
/usr/lib/qt3/lib/libqt-mt.so.3
/usr/lib/qt3/lib/libqt-mt.so.3.3
/usr/lib/qt3/lib/libqt-mt.so.3.3.4

> ldd /usr/lib/libqt-mt.so.3
linux-gate.so.1 =>  (0xffffe000)
libpng.so.3 => /usr/lib/libpng.so.3 (0x40733000)
libz.so.1 => /lib/libz.so.1 (0x40762000)
libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x40773000)
libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x4077b000)
libXrandr.so.2 => /usr/X11R6/lib/libXrandr.so.2 (0x40783000)
libXcursor.so.1 => /usr/X11R6/lib/libXcursor.so.1 (0x40787000)
libXft.so.2 => /usr/X11R6/lib/libXft.so.2 (0x40790000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x407a4000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x40813000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x4083d000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x4084b000)
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40947000)
libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x4094f000)
libdl.so.2 => /lib/libdl.so.2 (0x40968000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x4096c000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x4097e000)
libm.so.6 => /lib/tls/libm.so.6 (0x40a3b000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40a5e000)
libc.so.6 => /lib/tls/libc.so.6 (0x40a66000)
libexpat.so.0 => /usr/lib/libexpat.so.0 (0x40b7d000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

This bug occurs on my home PC as well as on my office PC (both SuSE 9.2)
Comment 6 Halla Rempt 2006-03-14 12:07:07 UTC
*** Bug 123604 has been marked as a duplicate of this bug. ***
Comment 7 Martin Koller 2006-11-25 22:22:38 UTC
I can confirm what you describe, although I don't know where to fix it ...
Comment 8 Brad Hards 2006-11-26 07:30:29 UTC
I tried opening this with the Qt4 plugandpaint example, and it renders correctly.
Comment 9 Brad Hards 2006-11-26 07:44:50 UTC
Works fine in the current development (KDE4) version of okular, which uses the qimgio plugin from Qt4.
Comment 10 Brad Hards 2006-11-26 07:55:39 UTC
Maksim: could you please take a look at this bug? 

Quick summary: JPEG images using CMYK render with an inverted colourspace. 

Works fine in the gimp, okular (which uses the Qt4 qimagio plugin) and the Qt4 plugandpaint example. Looks OK in the icon view in konqueror (Qt3/KDE3 only, I can't make the view work on KDE4).

Test image:
http://www.locus-caementitium.de/download/lcf_galerie.jpg 
[The cushions should be red, and the horizontal strips on the counter should be about the colour of pine wood.]
Comment 11 Maarten De Meyer 2013-05-07 23:46:54 UTC
(In reply to comment #10)
> [The cushions should be red, and the horizontal strips on the counter should
> be about the colour of pine wood.]

I have this as the preview of the file.
Looks fixed.