summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/io-xpm.c
diff options
context:
space:
mode:
authorMichael Meeks <mmeeks@src.gnome.org>1999-09-22 22:30:51 +0000
committerMichael Meeks <mmeeks@src.gnome.org>1999-09-22 22:30:51 +0000
commit6c13b03a451cd34e7674b311c3ef04c019963ee1 (patch)
tree421dee569b18bcbf2c0af4c5856e275f78328b7d /gdk-pixbuf/io-xpm.c
parent372c4d2627e4cb15a3bec51d051f4cc30afc5138 (diff)
downloadgtk+-6c13b03a451cd34e7674b311c3ef04c019963ee1.tar.gz
Add pixbuf_duplicate,
Fix 'scale' API, Add gdk_pixbuf_new, clean io modules a tad.
Diffstat (limited to 'gdk-pixbuf/io-xpm.c')
-rw-r--r--gdk-pixbuf/io-xpm.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/gdk-pixbuf/io-xpm.c b/gdk-pixbuf/io-xpm.c
index db78f1d931..6cd89fc3c1 100644
--- a/gdk-pixbuf/io-xpm.c
+++ b/gdk-pixbuf/io-xpm.c
@@ -306,6 +306,7 @@ static GdkPixBuf *
_XPMColor *colors, *color, *fallbackcolor;
art_u8 *pixels, *pixtmp;
GdkPixBuf *pixbuf;
+ ArtPixBuf *art_pixbuf;
buffer = (*get_buf) (op_header, handle);
if (!buffer) {
@@ -403,22 +404,15 @@ static GdkPixBuf *
/* Ok, now stuff the GdkPixBuf with goodies */
- pixbuf = g_new(GdkPixBuf, 1);
-
if (is_trans)
- pixbuf->art_pixbuf = art_pixbuf_new_rgba(pixels, w, h, (w * 4));
+ art_pixbuf = art_pixbuf_new_rgba(pixels, w, h, (w * 4));
else
- pixbuf->art_pixbuf = art_pixbuf_new_rgb(pixels, w, h, (w * 3));
+ art_pixbuf = art_pixbuf_new_rgb(pixels, w, h, (w * 3));
- /* Ok, I'm anal...shoot me */
- if (!(pixbuf->art_pixbuf)) {
- art_free(pixels);
- g_free(pixbuf);
- return NULL;
- }
+ pixbuf = gdk_pixbuf_new (art_pixbuf, NULL);
- pixbuf->ref_count = 1;
- pixbuf->unref_func = NULL;
+ if (!pixbuf)
+ art_free(pixels);
return pixbuf;
}