]> git.street.me.uk Git - andy/viking.git/blobdiff - src/thumbnails.c
[QA] Tidy up vikgoto header usage.
[andy/viking.git] / src / thumbnails.c
index 0461114b65554655f631eb1b75c0e42d20e4c670..c6d3a0c42b5fd821d85fcfc2633cfd0a1fbab6ff 100644 (file)
@@ -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);