summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/io-jpeg.c
diff options
context:
space:
mode:
authorA. Bosch <my+gnomebugs@progandy.de>2017-07-20 15:07:13 +0200
committerBastien Nocera <hadess@hadess.net>2017-07-27 12:05:51 +0100
commit6dd89e126a277460faafc1f679db44ccf78446fb (patch)
treef0125076ad50f39a3f529932adccd6dcced6a99e /gdk-pixbuf/io-jpeg.c
parentfbafdd06b0db36055cf6e181235fe8b29eef5c8c (diff)
downloadgdk-pixbuf-6dd89e126a277460faafc1f679db44ccf78446fb.tar.gz
jpeg: Restore grayscale image support
Commit c2a40a92fe3df4111ed9da51fe3368c079b86926 restricts the jpeg loader to files with 3 or 4 color components. Also allow JCS_GRAYSCALE images with only 1 color component. These grayscale images are supported through explode_gray_into_buf. https://bugzilla.gnome.org/show_bug.cgi?id=785171
Diffstat (limited to 'gdk-pixbuf/io-jpeg.c')
-rw-r--r--gdk-pixbuf/io-jpeg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index f59676f35..23284a74e 100644
--- a/gdk-pixbuf/io-jpeg.c
+++ b/gdk-pixbuf/io-jpeg.c
@@ -1090,6 +1090,9 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
has_alpha = FALSE;
} else if (cinfo->output_components == 4) {
has_alpha = TRUE;
+ } else if (cinfo->output_components == 1 &&
+ cinfo->out_color_space == JCS_GRAYSCALE) {
+ has_alpha = FALSE;
} else {
g_set_error (error,
GDK_PIXBUF_ERROR,