From: Benoît Pin <benoit.pin@gmail.com>
Date: Fri, 22 Oct 2010 17:50:44 +0000 (+0200)
Subject: Bugfixe : valeur par défaut quand l'orientation n'est pas dispo.
X-Git-Url: https://svn.cri.mines-paristech.fr/git/Photo.git/commitdiff_plain/refs/heads/master?ds=sidebyside

Bugfixe : valeur par défaut quand l'orientation n'est pas dispo.
---

diff --git a/Photo.py b/Photo.py
index 2161eaf..68b67f3 100755
--- a/Photo.py
+++ b/Photo.py
@@ -194,7 +194,7 @@ class Photo(Image, TileSupport, Metadata):
 	
 	def _rotateOrFlip(self, im) :
 		orientation = self.tiffOrientation()
-		rotation, flip = TIFF_ORIENTATIONS[orientation]
+		rotation, flip = TIFF_ORIENTATIONS.get(orientation, (0, False))
 		if rotation :
 			im = im.rotate(-rotation)
 		if flip :
diff --git a/TileSupport.py b/TileSupport.py
index 905b0f4..1dd9c0f 100644
--- a/TileSupport.py
+++ b/TileSupport.py
@@ -92,7 +92,7 @@ class TileSupport :
 		f = bf.open('r')
 		
 		orientation = self.tiffOrientation()
-		rotation, flip = TIFF_ORIENTATIONS[orientation]
+		rotation, flip = TIFF_ORIENTATIONS.get(orientation, (0, False))
 		
 		if rotation and flip :
 			tf = TemporaryFile(mode='w+')