--- a/degal/image.py Sun Jun 14 18:04:53 2009 +0300
+++ b/degal/image.py Sun Jun 14 18:08:55 2009 +0300
@@ -38,13 +38,21 @@
self.description = None
@lazy_load
- def pil_image (self) :
+ def img (self) :
"""
Loads the image as a PIL.Image
"""
# open it up
return PIL.Image.open(self.path)
+
+ @property
+ def img_size (self) :
+ """
+ Returns the pixel (width, height) resolution tuple of this image.
+ """
+
+ return self.img.size
@lazy_load
def exif (self) :
@@ -76,7 +84,7 @@
stat = self.stat()
# XXX: avoid having to open the image?
- size = self.pil_image.size
+ size = self.img_size
# build
metadata = dict({