Author: duncan
Date: Fri Oct 13 22:41:19 2006
New Revision: 8358

Modified:
   branches/rel-1-5/freevo/src/skins/main/skin_utils.py

Log:
[ 1573072 ] EXIF tag 0x112 'Orientation' in image viewer
Changed skin utils, seems to be the source code for this.


Modified: branches/rel-1-5/freevo/src/skins/main/skin_utils.py
==============================================================================
--- branches/rel-1-5/freevo/src/skins/main/skin_utils.py        (original)
+++ branches/rel-1-5/freevo/src/skins/main/skin_utils.py        Fri Oct 13 
22:41:19 2006
@@ -8,14 +8,6 @@
 # Todo:        
 #
 # -----------------------------------------------------------------------
-# $Log$
-# Revision 1.17  2004/07/10 12:33:41  dischi
-# header cleanup
-#
-# Revision 1.16  2004/02/01 17:51:14  dischi
-# respect item.rotation of images
-#
-# -----------------------------------------------------------------------
 # Freevo - A Home Theater PC framework
 # Copyright (C) 2002 Krister Lagerstrom, et al. 
 # Please see the file freevo/Docs/CREDITS for a complete list of authors.
@@ -44,6 +36,7 @@
 import osd
 import os
 import util
+from mmpython.image import EXIF as exif
 
 osd = osd.get_singleton()
 
@@ -87,6 +80,22 @@
                 image = osd.loadbitmap('thumb://%s' % item.image)
                 load_imagecache['thumb://%s' % item.image] = image
 
+        if not item['rotation']:
+            try:
+                f=open(item.filename, 'rb')
+                tags=exif.process_file(f)
+                f.close()
+                if tags.has_key('Image Orientation'):
+                    orientation = tags['Image Orientation']
+                    if str(orientation) == "Rotated 90 CCW":
+                        item['rotation'] = 90
+                    elif str(orientation) == "Rotated 180":
+                        item['rotation'] = 180
+                    elif str(orientation) == "Rotated 90 CW":
+                        item['rotation'] = 270
+            except Exception, e:
+                pass
+
         if item['rotation']:
             image = pygame.transform.rotate(image, item['rotation'])
             

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to