[gdk-pixbuf] jpeg: Restore grayscale image support
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf] jpeg: Restore grayscale image support
- Date: Thu, 27 Jul 2017 11:06:44 +0000 (UTC)
commit 6dd89e126a277460faafc1f679db44ccf78446fb
Author: A. Bosch <my+gnomebugs progandy de>
Date: Thu Jul 20 15:07:13 2017 +0200
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
gdk-pixbuf/io-jpeg.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index f59676f..23284a7 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]