diff options
| author | 2008-12-20 02:20:07 +0000 | |
|---|---|---|
| committer | 2008-12-20 02:20:07 +0000 | |
| commit | 863be5f46911f2da390e106d3fb40e8cb752260c (patch) | |
| tree | 7d58caa2cbda1492575d8776501f8505098bfb13 | |
| parent | 83047774827f8d737e2de8193af75931259ba1c1 (diff) | |
| download | gdk-pixbuf-psd-863be5f46911f2da390e106d3fb40e8cb752260c.tar.gz gdk-pixbuf-psd-863be5f46911f2da390e106d3fb40e8cb752260c.tar.bz2 | |
Support for duotone (interpreted as grayscale)
git-svn-id: http://gdk-pixbuf-psd.googlecode.com/svn/trunk@17 c5539ac3-5556-0410-9a1f-7faf0b045682
| -rw-r--r-- | io-psd.c | 7 |
1 files changed, 5 insertions, 2 deletions
| @@ -105,7 +105,7 @@ typedef struct | |||
| 105 | guchar** ch_bufs; /* channels buffers */ | 105 | guchar** ch_bufs; /* channels buffers */ |
| 106 | guint curr_ch; /* current channel */ | 106 | guint curr_ch; /* current channel */ |
| 107 | guint curr_row; | 107 | guint curr_row; |
| 108 | guint pos; // redundant? | 108 | guint pos; |
| 109 | guint16* lines_lengths; | 109 | guint16* lines_lengths; |
| 110 | gboolean finalized; | 110 | gboolean finalized; |
| 111 | gboolean use_alpha; | 111 | gboolean use_alpha; |
| @@ -350,6 +350,7 @@ gdk_pixbuf__psd_image_load_increment (gpointer context_ptr, | |||
| 350 | if (ctx->color_mode != PSD_MODE_RGB | 350 | if (ctx->color_mode != PSD_MODE_RGB |
| 351 | && ctx->color_mode != PSD_MODE_GRAYSCALE | 351 | && ctx->color_mode != PSD_MODE_GRAYSCALE |
| 352 | && ctx->color_mode != PSD_MODE_CMYK | 352 | && ctx->color_mode != PSD_MODE_CMYK |
| 353 | && ctx->color_mode != PSD_MODE_DUOTONE | ||
| 353 | ) { | 354 | ) { |
| 354 | g_set_error (error, GDK_PIXBUF_ERROR, | 355 | g_set_error (error, GDK_PIXBUF_ERROR, |
| 355 | GDK_PIXBUF_ERROR_UNKNOWN_TYPE, | 356 | GDK_PIXBUF_ERROR_UNKNOWN_TYPE, |
| @@ -522,7 +523,9 @@ gdk_pixbuf__psd_image_load_increment (gpointer context_ptr, | |||
| 522 | } | 523 | } |
| 523 | pixels += gdk_pixbuf_get_rowstride(ctx->pixbuf); | 524 | pixels += gdk_pixbuf_get_rowstride(ctx->pixbuf); |
| 524 | } | 525 | } |
| 525 | } else if (ctx->color_mode == PSD_MODE_GRAYSCALE) { | 526 | } else if (ctx->color_mode == PSD_MODE_GRAYSCALE || |
| 527 | ctx->color_mode == PSD_MODE_DUOTONE) | ||
| 528 | { | ||
| 526 | for (int i = 0; i < ctx->height; i++) { | 529 | for (int i = 0; i < ctx->height; i++) { |
| 527 | for (int j = 0; j < ctx->width; j++) { | 530 | for (int j = 0; j < ctx->width; j++) { |
| 528 | pixels[3*j+0] = pixels[3*j+1] = pixels[3*j+2] = | 531 | pixels[3*j+0] = pixels[3*j+1] = pixels[3*j+2] = |
