[gdk-pixbuf] jpeg: Assume that CMYK JPEGs are inverted CMYK



commit 4f5da4dff05e75c2fc12367d8a5fc237a76749ec
Author: Matthieu Gautier <dev mgautier fr>
Date:   Tue Oct 28 16:35:00 2014 +0000

    jpeg: Assume that CMYK JPEGs are inverted CMYK
    
    Photoshop seems to assume that CMYK JPEGs are in inverted CMYK format.
    We now do the same. Hopefully it won't cause problems as most CMYK files
    around are probably produced by that program.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=618096

 gdk-pixbuf/io-jpeg.c |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index 55a782b..8e594eb 100644
--- a/gdk-pixbuf/io-jpeg.c
+++ b/gdk-pixbuf/io-jpeg.c
@@ -190,16 +190,13 @@ convert_cmyk_to_rgb (struct jpeg_decompress_struct *cinfo,
                        m = p[1];
                        y = p[2];
                        k = p[3];
-                       if (cinfo->saw_Adobe_marker) {
-                               p[0] = k*c / 255;
-                               p[1] = k*m / 255;
-                               p[2] = k*y / 255;
-                       }
-                       else {
-                               p[0] = (255 - k)*(255 - c) / 255;
-                               p[1] = (255 - k)*(255 - m) / 255;
-                               p[2] = (255 - k)*(255 - y) / 255;
-                       }
+
+                       /* We now assume that all CMYK JPEG files
+                        * use inverted CMYK, as Photoshop does
+                        * See https://bugzilla.gnome.org/show_bug.cgi?id=618096 */
+                       p[0] = k*c / 255;
+                       p[1] = k*m / 255;
+                       p[2] = k*y / 255;
                        p[3] = 255;
                        p += 4;
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]