From a80528f9d3fcb22965ed22ded83dc7ee6a1605ae Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 6 May 2011 07:55:47 -0400 Subject: Finishing up core. --- scanner/PhotoAlbum.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scanner/PhotoAlbum.py') diff --git a/scanner/PhotoAlbum.py b/scanner/PhotoAlbum.py index 33ea437..b5c6377 100644 --- a/scanner/PhotoAlbum.py +++ b/scanner/PhotoAlbum.py @@ -110,6 +110,7 @@ class Photo(object): self._metadata(image) self._thumbnails(image, thumb_path) def _metadata(self, image): + self._attributes["size"] = image.size try: info = image._getexif() except: @@ -125,8 +126,11 @@ class Photo(object): try: value = datetime.strptime(value, '%Y:%m:%d %H:%M:%S') except: - pass + pass self._attributes[decoded] = value + + if "Orientation" in self._attributes and self._attributes["Orientation"] in range(5, 9): + self._attributes["size"] = (self._attributes["size"][1], self._attributes["size"][0]) def _thumbnail(self, image, thumb_path, size, square=False): thumb_path = os.path.join(thumb_path, image_cache(self._path, size, square)) print "Thumbing %s" % thumb_path -- cgit v1.2.3-59-g8ed1b