summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/io-jpeg.c
diff options
context:
space:
mode:
authorMichael Fulbright <drmike@src.gnome.org>1999-10-29 23:07:23 +0000
committerMichael Fulbright <drmike@src.gnome.org>1999-10-29 23:07:23 +0000
commitfcdf9472054e3e36b2e43c6925dd3f63d5e44f80 (patch)
treea7db7c4cf1e2c90352ec0745869b22f4fcdccf92 /gdk-pixbuf/io-jpeg.c
parent40dfa38a3602a513b026fd4fa2fa2f1c85e0cd6f (diff)
downloadgtk+-fcdf9472054e3e36b2e43c6925dd3f63d5e44f80.tar.gz
Fixed small oopsie with grayscale jpeg handling - still not working for progressive
Diffstat (limited to 'gdk-pixbuf/io-jpeg.c')
-rw-r--r--gdk-pixbuf/io-jpeg.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index 598d38f778..82954d6134 100644
--- a/gdk-pixbuf/io-jpeg.c
+++ b/gdk-pixbuf/io-jpeg.c
@@ -137,8 +137,8 @@ explode_gray_into_buf (struct jpeg_decompress_struct *cinfo,
to = lines[i] + (w - 1) * 3;
for (j = w - 1; j >= 0; j--) {
to[0] = from[0];
- to[1] = from[1];
- to[2] = from[2];
+ to[1] = from[0];
+ to[2] = from[0];
to -= 3;
from--;
}
@@ -447,7 +447,7 @@ image_load_increment (gpointer data, guchar *buf, guint size)
/* we're decompressing so feed jpeg lib scanlines */
guchar *lines[4];
guchar **lptr;
- guchar *rowptr;
+ guchar *rowptr, *p;
gint nlines, i;
gint start_scanline;
@@ -458,8 +458,11 @@ image_load_increment (gpointer data, guchar *buf, guint size)
rowptr = context->dptr;
for (i=0; i < cinfo->rec_outbuf_height; i++) {
*lptr++ = rowptr;
- rowptr += context->pixbuf->art_pixbuf->rowstride;;
+ rowptr += context->pixbuf->art_pixbuf->rowstride;;
}
+
+ for (p=lines[0],i=0; i< context->pixbuf->art_pixbuf->rowstride;i++, p++)
+ *p = 0;
nlines = jpeg_read_scanlines (cinfo, lines,
cinfo->rec_outbuf_height);
@@ -489,6 +492,8 @@ image_load_increment (gpointer data, guchar *buf, guint size)
nlines, cinfo->src->bytes_in_buffer);
#endif
}
+ /* did entire image */
+ return TRUE;
}
}