]> CRI, Mines Paris - PSL - Photo.git/commitdiff
Bugfixe : valeur par défaut quand l'orientation n'est pas dispo. master
authorBenoît Pin <benoit.pin@gmail.com>
Fri, 22 Oct 2010 17:50:44 +0000 (19:50 +0200)
committerBenoît Pin <benoit.pin@gmail.com>
Fri, 22 Oct 2010 17:50:44 +0000 (19:50 +0200)
Photo.py
TileSupport.py

index 2161eaf0593fd2db598d2056cdd25ba0af6d4a20..68b67f37f66e85bb53330fca0f35361a6b3428c3 100755 (executable)
--- 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 :
index 905b0f40fd9973a81dbd7a7990a17352b34bc9dd..1dd9c0f7aeaf761bf21acc72e84bc9c1737d09ea 100644 (file)
@@ -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+')