diff options
author | Keith Isdale <keith.isdale@nokia.com> | 2009-08-27 03:55:41 (GMT) |
---|---|---|
committer | Keith Isdale <keith.isdale@nokia.com> | 2009-08-27 03:55:41 (GMT) |
commit | b0cc2440829ce0deb7e81fd61933c5f4f0e8942c (patch) | |
tree | 4f42d823db8441a0de88edb84e7cf25070316dd9 | |
parent | 47a1aa988b6ebe397820a23cae460f7b68004788 (diff) | |
download | Qt-b0cc2440829ce0deb7e81fd61933c5f4f0e8942c.zip Qt-b0cc2440829ce0deb7e81fd61933c5f4f0e8942c.tar.gz Qt-b0cc2440829ce0deb7e81fd61933c5f4f0e8942c.tar.bz2 |
QImageReader via JPEG image load plugin fails to load correctly a CMYK
encoded JPEG
CMKY encoded JPEG code missing from scaled image JPEG loading
Task-number: 260192
Reviewed-by: Stian Sandvik Thomassen
-rw-r--r-- | src/plugins/imageformats/jpeg/qjpeghandler.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp index e8728c6..81ef60b 100644 --- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp +++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp @@ -493,7 +493,16 @@ private: in--; out[i] = qRgb(*in, *in, *in); } - } else { + } else if (cinfo->out_color_space == JCS_CMYK) { + int cols32Bit = scaledWidth() * 4; + in = (uchar*)out + cols32Bit; + for (uint i = scaledWidth(); i--; ) { + in -= 4; + int k = in[3]; + out[i] = qRgb(k * in[0] / 255, k * in[1] / 255, k * in[2] / 255); + //out[i] = qRgb(in[0], in[1], in[2]); + } + } else { in = (uchar*)out + cols24Bit; for (uint i = scaledWidth(); i--; ) { in -= 3; |