Author: duncan
Date: Mon Oct  8 16:36:24 2007
New Revision: 9938

Log:
The imageview was not handling revered images very well, this should now be 
fixed
The scaling was incorrect but now looks good


Modified:
   branches/rel-1/freevo/src/encodingcore.py
   branches/rel-1/freevo/src/image/viewer.py
   branches/rel-1/freevo/src/osd.py

Modified: branches/rel-1/freevo/src/encodingcore.py
==============================================================================
--- branches/rel-1/freevo/src/encodingcore.py   (original)
+++ branches/rel-1/freevo/src/encodingcore.py   Mon Oct  8 16:36:24 2007
@@ -455,10 +455,8 @@
             pass
         for line in lines:
             line = line.strip('\n')
-            #print 'DJW:line:',line
             if re_crop.search(line):
                 crop = re_crop.search(line).group(1)
-                #print 'DJW:crop:',crop
                 try:
                     crop_options[crop] = crop_options[crop] + 1
                     #if crop_options[crop] > cc_hits:

Modified: branches/rel-1/freevo/src/image/viewer.py
==============================================================================
--- branches/rel-1/freevo/src/image/viewer.py   (original)
+++ branches/rel-1/freevo/src/image/viewer.py   Mon Oct  8 16:36:24 2007
@@ -111,10 +111,7 @@
             item.menuw.show_callbacks.append(self.free_cache)
 
         self.filename = filename
-        if config.IMAGEVIEWER_REVERSED_IMAGES:
-            self.rotation = (360 - rotation) % 360
-        else:
-            self.rotation = rotation
+        self.rotation = rotation
 
         if filename and len(filename) > 0:
             image = self.osd.loadbitmap(filename, cache=self.bitmapcache)
@@ -142,22 +139,40 @@
 
         if zoom:
             # Translate the 9-element grid to bounding boxes
-            if self.rotation == 90:
-                bb = { 1:(2,0), 2:(2,1), 3:(2,2),
-                       4:(1,0), 5:(1,1), 6:(1,2),
-                       7:(0,0), 8:(0,1), 9:(0,2) }
-            elif self.rotation == 180:
-                bb = { 1:(2,2), 2:(1,2), 3:(0,2),
-                       4:(2,1), 5:(1,1), 6:(0,1),
-                       7:(2,0), 8:(1,0), 9:(0,0) }
-            elif self.rotation == 270:
-                bb = { 1:(0,2), 2:(0,1), 3:(0,0),
-                       4:(1,2), 5:(1,1), 6:(1,0),
-                       7:(2,2), 8:(2,1), 9:(2,0) }
+            if config.IMAGEVIEWER_REVERSED_IMAGES:
+                if self.rotation == 90:
+                    bb = { 1:(2,2), 2:(2,1), 3:(2,0),
+                           4:(1,2), 5:(1,1), 6:(1,0),
+                           7:(0,2), 8:(0,1), 9:(0,0) }
+                elif self.rotation == 180:
+                    bb = { 1:(2,0), 2:(1,0), 3:(0,0),
+                           4:(2,1), 5:(1,1), 6:(0,1),
+                           7:(2,2), 8:(1,2), 9:(0,2) }
+                elif self.rotation == 270:
+                    bb = { 1:(0,0), 2:(0,1), 3:(0,2),
+                           4:(1,0), 5:(1,1), 6:(1,2),
+                           7:(2,0), 8:(2,1), 9:(2,2) }
+                else:
+                    bb = { 1:(0,2), 2:(1,2), 3:(2,2),
+                           4:(0,1), 5:(1,1), 6:(2,1),
+                           7:(0,0), 8:(1,0), 9:(2,0) }
             else:
-                bb = { 1:(0,0), 2:(1,0), 3:(2,0),
-                       4:(0,1), 5:(1,1), 6:(2,1),
-                       7:(0,2), 8:(1,2), 9:(2,2) }
+                if self.rotation == 90:
+                    bb = { 1:(2,0), 2:(2,1), 3:(2,2),
+                           4:(1,0), 5:(1,1), 6:(1,2),
+                           7:(0,0), 8:(0,1), 9:(0,2) }
+                elif self.rotation == 180:
+                    bb = { 1:(2,2), 2:(1,2), 3:(0,2),
+                           4:(2,1), 5:(1,1), 6:(0,1),
+                           7:(2,0), 8:(1,0), 9:(0,0) }
+                elif self.rotation == 270:
+                    bb = { 1:(0,2), 2:(0,1), 3:(0,0),
+                           4:(1,2), 5:(1,1), 6:(1,0),
+                           7:(2,2), 8:(2,1), 9:(2,0) }
+                else:
+                    bb = { 1:(0,0), 2:(1,0), 3:(2,0),
+                           4:(0,1), 5:(1,1), 6:(2,1),
+                           7:(0,2), 8:(1,2), 9:(2,2) }
 
             if isinstance(zoom, int):
                 h, v = bb[zoom]
@@ -324,6 +339,8 @@
 
     def eventhandler(self, event, menuw=None):
         _debug_('eventhandler(event=%s, menuw=%s)' % (event, menuw), 2)
+        if event and hasattr(event, 'arg'):
+        else:
         if event == PAUSE or event == PLAY:
             if self.slideshow:
                 rc.post_event(Event(OSD_MESSAGE, arg=_('pause')))

Modified: branches/rel-1/freevo/src/osd.py
==============================================================================
--- branches/rel-1/freevo/src/osd.py    (original)
+++ branches/rel-1/freevo/src/osd.py    Mon Oct  8 16:36:24 2007
@@ -748,15 +748,19 @@
             imbb.blit(image, (0, 0), (bbx, bby, bbw, bbh))
             image = imbb
 
+        if config.IMAGEVIEWER_REVERSED_IMAGES:
+            rotation = (360 - rotation) % 360
         if scaling:
             w, h = image.get_size()
-            h = int(h*scaling)
             if rotation % 180:
                 w = int(float(w) * scaling)
+                h = int(float(h) * scaling / config.IMAGEVIEWER_ASPECT)
             else:
                 w = int(float(w) * scaling / config.IMAGEVIEWER_ASPECT)
-            image = pygame.transform.rotozoom(image, rotation, scaling)
+                h = int(float(h) * scaling)
             image = pygame.transform.scale(image, (w, h))
+            image = pygame.transform.rotozoom(image, rotation, 1.0)
+            #image = pygame.transform.rotozoom(image, rotation, scaling)
 
         elif rotation:
             image = pygame.transform.rotate(image, rotation)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to