degal/thumbnail.py
changeset 95 3b00bd676fc9
parent 85 7da934333469
child 115 d5aa320697df
--- a/degal/thumbnail.py	Thu Jun 11 21:46:20 2009 +0300
+++ b/degal/thumbnail.py	Thu Jun 11 21:50:48 2009 +0300
@@ -19,9 +19,8 @@
             `size` determines the target resolution of the output thumbnail.
         """
 
-        # our file path
-        # XXX: this should be the binary fsname, not name
-        super(Thumbnail, self).__init__(subdir.subnode(image.name))
+        # our file path, image name inside of the given subdir
+        super(Thumbnail, self).__init__(subdir, image.fsname)
 
         # store
         self.image = image
@@ -32,7 +31,13 @@
             Tests if this thumbnail is stale
         """
         
-        return self.older_than(self.image)
+        if self.image.older_than(self) :
+            # both exist and this is newer
+            return False
+        
+        else :
+            # this thumb doesn't exist or is older
+            return True
 
     def update (self) :
         """
@@ -47,4 +52,4 @@
 
         # and write out
         thumb.save(self.path)
-
+