#undef MIN /* quit yer whining, gcc */
#undef MAX
-#include <sys/param.h> /* for realpath() */
#ifndef MAX
/* We need MAX macro and some system does not offer it */
#define MAX(a,b) (((a)>(b))?(a):(b))
#ifdef WINDOWS
#define THUMB_DIR "\\THUMBNAILS\\" /* viking maps default viking\maps */
#define THUMB_SUB_DIR "normal\\"
-#define realpath(X,Y) _fullpath(Y,X,MAX_PATH)
-
#else
#define THUMB_DIR "/.thumbnails/"
#define THUMB_SUB_DIR "normal/"
if (w <= max_w && h <= max_h)
{
- gdk_pixbuf_ref(src);
+ g_object_ref ( G_OBJECT ( src ) );
return src;
}
else
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;
if (image)
{
GdkPixbuf *thumb = save_thumbnail(path, image);
- gdk_pixbuf_unref ( image );
+ g_object_unref ( G_OBJECT ( image ) );
return thumb;
}
goto out;
err:
if (thumb)
- gdk_pixbuf_unref(thumb);
+ g_object_unref ( G_OBJECT ( thumb ) );
thumb = NULL;
out:
g_free(path);
g_return_val_if_fail(path != NULL, NULL);
- if (realpath(path, real))
+ if (file_realpath(path, real))
return g_strdup(real);
return g_strdup(path);