summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Gautier <dev@mgautier.fr>2014-10-28 16:35:00 +0000
committerBastien Nocera <hadess@hadess.net>2014-11-18 19:41:01 +0100
commit4f5da4dff05e75c2fc12367d8a5fc237a76749ec (patch)
treedb00ad38769ed80ae02eb63058262bc8fd2bf11d
parent497d2003401934567f2f8e6fac316f9d381e686a (diff)
downloadgdk-pixbuf-4f5da4dff05e75c2fc12367d8a5fc237a76749ec.tar.gz
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
-rw-r--r--gdk-pixbuf/io-jpeg.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index 55a782b60..8e594ebca 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;
}