Author: dmeyer
Date: Tue Oct  3 19:10:12 2006
New Revision: 1911

Modified:
   trunk/beacon/src/server.py
   trunk/metadata/src/image/core.py
   trunk/metadata/src/image/jpginfo.py

Log:
support image rotation info in exif tag

Modified: trunk/beacon/src/server.py
==============================================================================
--- trunk/beacon/src/server.py  (original)
+++ trunk/beacon/src/server.py  Tue Oct  3 19:10:12 2006
@@ -110,6 +110,7 @@
             width = (int, ATTR_SEARCHABLE),
             height = (int, ATTR_SEARCHABLE),
             comment = (unicode, ATTR_KEYWORDS | ATTR_IGNORE_CASE),
+            rotation = (int, ATTR_SIMPLE), 
             date = (unicode, ATTR_SEARCHABLE))
 
         # tracks for rom discs or iso files

Modified: trunk/metadata/src/image/core.py
==============================================================================
--- trunk/metadata/src/image/core.py    (original)
+++ trunk/metadata/src/image/core.py    Tue Oct  3 19:10:12 2006
@@ -45,7 +45,7 @@
 
 # attributes for image files
 ATTRIBUTES = ['description', 'people', 'location', 'event', 'width', 'height',
-              'thumbnail','software','hardware', 'dpi', 'city']
+              'thumbnail','software','hardware', 'dpi', 'city', 'rotation']
 
 
 class ImageInfo(mediainfo.MediaInfo):

Modified: trunk/metadata/src/image/jpginfo.py
==============================================================================
--- trunk/metadata/src/image/jpginfo.py (original)
+++ trunk/metadata/src/image/jpginfo.py Tue Oct  3 19:10:12 2006
@@ -117,6 +117,15 @@
                         self.setitem( 'software', exif, 'Image Software', True)
                         self.setitem( 'thumbnail', exif, 'JPEGThumbnail', True)
                         self.appendtable( 'EXIF', exif )
+
+                        if 'Image Orientation' in exif:
+                            orientation = str(exif['Image Orientation'])
+                            if orientation.find('90 CW') > 0:
+                                self.rotation = 90
+                            elif orientation.find('90') > 0:
+                                self.rotation = 270
+                            elif orientation.find('180') > 0:
+                                self.rotation = 180
                 elif type == 'http://ns.adobe.com/xap/1.0/':
                     doc = libxml2.parseDoc(data[data.find('\0')+1:])
                     # FIXME: parse XMP data

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to