skip ascii thumb resizing if necessary
authorRodney Ewing <ewing.rj@gmail.com>
Thu, 22 Aug 2013 17:06:50 +0000 (10:06 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Thu, 19 Sep 2013 15:12:09 +0000 (08:12 -0700)
mediagoblin/media_types/ascii/processing.py

index ef4727de243d242e64fca703d8d80d44cb62f584..b3c2a298e1f8304a0277e80288d51feef6824888 100644 (file)
@@ -157,22 +157,22 @@ class CommonAsciiProcessor(MediaProcessor):
             store_public(self.entry, 'thumb', tmp_thumb,
                          self.name_builder.fill('{basename}.thumbnail.jpg'))
 
-        def _skip_resizing(self, font, thumb_size):
-            thumb_info = self.entry.get_file_metadata('thumb')
+    def _skip_resizing(self, font, thumb_size):
+        thumb_info = self.entry.get_file_metadata('thumb')
 
-            if not thumb_info:
-                return False
+        if not thumb_info:
+            return False
 
-            skip = True
+        skip = True
 
-            if thumb_info.get('font') != font:
-                skip = False
-            elif thumb_info.get('width') != thumb_size[0]:
-                skip = False
-            elif thumb_info.get('height') != thumb_size[1]:
-                skip = False
+        if thumb_info.get('font') != font:
+            skip = False
+        elif thumb_info.get('width') != thumb_size[0]:
+            skip = False
+        elif thumb_info.get('height') != thumb_size[1]:
+            skip = False
 
-            return skip
+        return skip
 
 
 class InitialProcessor(CommonAsciiProcessor):