From 863be5f46911f2da390e106d3fb40e8cb752260c Mon Sep 17 00:00:00 2001 From: jan.dudek Date: Sat, 20 Dec 2008 02:20:07 +0000 Subject: Support for duotone (interpreted as grayscale) git-svn-id: http://gdk-pixbuf-psd.googlecode.com/svn/trunk@17 c5539ac3-5556-0410-9a1f-7faf0b045682 --- io-psd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/io-psd.c b/io-psd.c index ccc7db0..868bf4e 100644 --- a/io-psd.c +++ b/io-psd.c @@ -105,7 +105,7 @@ typedef struct guchar** ch_bufs; /* channels buffers */ guint curr_ch; /* current channel */ guint curr_row; - guint pos; // redundant? + guint pos; guint16* lines_lengths; gboolean finalized; gboolean use_alpha; @@ -350,6 +350,7 @@ gdk_pixbuf__psd_image_load_increment (gpointer context_ptr, if (ctx->color_mode != PSD_MODE_RGB && ctx->color_mode != PSD_MODE_GRAYSCALE && ctx->color_mode != PSD_MODE_CMYK + && ctx->color_mode != PSD_MODE_DUOTONE ) { g_set_error (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_UNKNOWN_TYPE, @@ -522,7 +523,9 @@ gdk_pixbuf__psd_image_load_increment (gpointer context_ptr, } pixels += gdk_pixbuf_get_rowstride(ctx->pixbuf); } - } else if (ctx->color_mode == PSD_MODE_GRAYSCALE) { + } else if (ctx->color_mode == PSD_MODE_GRAYSCALE || + ctx->color_mode == PSD_MODE_DUOTONE) + { for (int i = 0; i < ctx->height; i++) { for (int j = 0; j < ctx->width; j++) { pixels[3*j+0] = pixels[3*j+1] = pixels[3*j+2] = -- cgit v1.1-32-gdbae