summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/io-jpeg.c
diff options
context:
space:
mode:
authorMichael Fulbright <drmike@redhat.com>1999-11-05 00:16:10 +0000
committerMichael Fulbright <drmike@src.gnome.org>1999-11-05 00:16:10 +0000
commit01fcce4cf94c948b0c4ee88f7cca9ccb5ae472f5 (patch)
tree82d0b4ba2252798816c4eb738dcb8b8ca0f7c605 /gdk-pixbuf/io-jpeg.c
parentf527b8909f4aefbde3022da5270a5f3c0ec12587 (diff)
downloadgtk+-01fcce4cf94c948b0c4ee88f7cca9ccb5ae472f5.tar.gz
Prettied up code slightly. Start of pnm loader (from file and
999-11-04 Michael Fulbright <drmike@redhat.com> * src/io-jpeg.c: Prettied up code slightly. * src/io-pnm.c: Start of pnm loader (from file and progressively). Doesn't do much yet (will finish tomorrow). * src/gdk-pixbuf-io.c: Added pnm to structure of known types.
Diffstat (limited to 'gdk-pixbuf/io-jpeg.c')
-rw-r--r--gdk-pixbuf/io-jpeg.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index cdc162fe93..119e9e5173 100644
--- a/gdk-pixbuf/io-jpeg.c
+++ b/gdk-pixbuf/io-jpeg.c
@@ -150,7 +150,7 @@ explode_gray_into_buf (struct jpeg_decompress_struct *cinfo,
GdkPixbuf *
image_load (FILE *f)
{
- int w, h, i;
+ gint w, h, i;
guchar *pixels = NULL;
guchar *dptr;
guchar *lines[4]; /* Used to expand rows, via rec_outbuf_height,
@@ -161,7 +161,6 @@ image_load (FILE *f)
guchar **lptr;
struct jpeg_decompress_struct cinfo;
struct error_handler_data jerr;
- GdkPixbuf *pixbuf;
/* setup error handler */
cinfo.err = jpeg_std_error (&jerr.pub);
@@ -187,7 +186,7 @@ image_load (FILE *f)
w = cinfo.output_width;
h = cinfo.output_height;
- pixels = malloc (h * w * 3);
+ pixels = g_malloc (h * w * 3);
if (!pixels) {
jpeg_destroy_decompress (&cinfo);
return NULL;
@@ -216,8 +215,6 @@ image_load (FILE *f)
return gdk_pixbuf_new_from_data (pixels, ART_PIX_RGB, FALSE,
w, h, w * 3,
free_buffer, NULL);
-
- return pixbuf;
}