aboutsummaryrefslogtreecommitdiffstats
path: root/PhotoAlbum.py
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2011-05-05 09:17:21 -0400
committerJason A. Donenfeld <Jason@zx2c4.com>2011-05-05 09:17:21 -0400
commitff5aac5badcfbe93ce86bbb60c3d45c575acd4fd (patch)
tree5982938c532257e9872374e73c49790e511736bb /PhotoAlbum.py
parentOnly give last part of path in subalbum listings. (diff)
downloadPhotoFloat-ff5aac5badcfbe93ce86bbb60c3d45c575acd4fd.tar.xz
PhotoFloat-ff5aac5badcfbe93ce86bbb60c3d45c575acd4fd.zip
Little bugs and status output.
Diffstat (limited to 'PhotoAlbum.py')
-rw-r--r--PhotoAlbum.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/PhotoAlbum.py b/PhotoAlbum.py
index 547ad61..ec91b8a 100644
--- a/PhotoAlbum.py
+++ b/PhotoAlbum.py
@@ -140,6 +140,7 @@ class Photo(object):
else:
suffix = str(size)
thumb_path = os.path.join(thumb_path, image_cache(self._path, suffix))
+ print "Thumbing %s" % thumb_path
if os.path.exists(thumb_path) and datetime.fromtimestamp(os.path.getmtime(thumb_path)) >= self._attributes["DateTimeFile"]:
return
image = image.copy()
@@ -159,7 +160,10 @@ class Photo(object):
image.save(thumb_path, "JPEG")
def _thumbnails(self, image, thumb_path):
- orientation = self._attributes["Orientation"]
+ if "Orientation" in self._attributes:
+ orientation = self._attributes["Orientation"]
+ else:
+ orientation = 1
mirror = image
if orientation == 2:
# Vertical Mirror
@@ -214,7 +218,7 @@ class Photo(object):
dictionary[key] = datetime.strptime(dictionary[key], "%a %b %d %H:%M:%S %Y")
except:
pass
- return Photo(path, dictionary)
+ return Photo(path, None, dictionary)
def to_dict(self):
photo = { "name": self.name, "date": self.date }
photo.update(self.attributes)