X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/82331b4c4e7d40c51676211beda3c19560a1576b..3d2c0c26c8a259770e3dd30d0a5a6553f01efc97:/src/thumbnails.c?ds=sidebyside diff --git a/src/thumbnails.c b/src/thumbnails.c index 0461114b..c6d3a0c4 100644 --- a/src/thumbnails.c +++ b/src/thumbnails.c @@ -122,7 +122,7 @@ GdkPixbuf *a_thumbnails_scale_pixbuf(GdkPixbuf *src, int max_w, int max_h) if (w <= max_w && h <= max_h) { - gdk_pixbuf_ref(src); + g_object_ref ( G_OBJECT ( src ) ); return src; } else @@ -145,6 +145,9 @@ static GdkPixbuf *child_create_thumbnail(const gchar *path) GdkPixbuf *image, *tmpbuf; image = gdk_pixbuf_new_from_file(path, NULL); + if (!image) + return NULL; + tmpbuf = gdk_pixbuf_apply_embedded_orientation(image); g_object_unref(G_OBJECT(image)); image = tmpbuf; @@ -152,7 +155,7 @@ static GdkPixbuf *child_create_thumbnail(const gchar *path) if (image) { GdkPixbuf *thumb = save_thumbnail(path, image); - gdk_pixbuf_unref ( image ); + g_object_unref ( G_OBJECT ( image ) ); return thumb; } @@ -286,7 +289,7 @@ GdkPixbuf *a_thumbnails_get(const gchar *pathname) goto out; err: if (thumb) - gdk_pixbuf_unref(thumb); + g_object_unref ( G_OBJECT ( thumb ) ); thumb = NULL; out: g_free(path);