src/lib/image.c
changeset 5 4b440fa03183
parent 4 49362b34116c
child 6 766df7c9b90d
--- a/src/lib/image.c	Mon Dec 28 20:36:29 2009 +0200
+++ b/src/lib/image.c	Mon Dec 28 20:43:33 2009 +0200
@@ -145,7 +145,6 @@
 {
     struct pt_image *image;
     char cache_path[_POSIX_PATH_MAX];
-    int stale;
 
     // XXX: verify that the path exists and looks like a PNG file
 
@@ -161,17 +160,6 @@
     if (pt_cache_open(&image->cache, cache_path, cache_mode))
         goto error;
     
-    // compare cache with image
-    // XXX: check cache_mode
-    if ((stale = pt_cache_stale(image->cache, image->path)) < 0)
-        goto error;
-
-    // update if not fresh
-    if (stale) {
-        if (pt_image_update_cache(image))
-            goto error;
-    }
-
     // ok, ready for access
     *image_ptr = image;
 
@@ -183,6 +171,17 @@
     return -1;
 }
 
+int pt_image_stale (struct pt_image *image)
+{
+    return pt_cache_stale(image->cache, image->path);
+}
+
+int pt_image_update (struct pt_image *image)
+{
+    return pt_image_update_cache(image);
+}
+
+
 void pt_image_destroy (struct pt_image *image)
 {
     free(image->path);