end of day commit
authorRodney Ewing <ewing.rj@gmail.com>
Thu, 1 Aug 2013 22:58:57 +0000 (15:58 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Fri, 16 Aug 2013 22:30:14 +0000 (15:30 -0700)
mediagoblin/media_types/image/__init__.py

index 1bb9c6f3edb9a1ffae69beb98266c339abb65af8..9e2d4ad7f98eb406a173f6a03fad932bdd25cc5d 100644 (file)
@@ -19,6 +19,7 @@ from mediagoblin.media_types import MediaManagerBase
 from mediagoblin.media_types.image.processing import process_image, \
     sniff_handler
 from mediagoblin.tools import pluginapi
+from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
 
 
 ACCEPTED_EXTENSIONS = ["jpg", "jpeg", "png", "gif", "tiff"]
@@ -64,9 +65,25 @@ def get_media_type_and_manager(ext):
         return MEDIA_TYPE, ImageMediaManager
 
 
+def reprocess_action(args):
+    if args[0].state == 'processed':
+        print _('\n Available reprocessing actions for processed images:'
+                '\n \t --resize: thumbnail or medium'
+                '\n Options:'
+                '\n \t --size: max_width max_height (defaults to config specs)')
+        return True
+
+
+def media_reprocess(args):
+    import ipdb
+    ipdb.set_trace()
+
+
 hooks = {
     'setup': setup_plugin,
     'get_media_type_and_manager': get_media_type_and_manager,
     'sniff_handler': sniff_handler,
     ('media_manager', MEDIA_TYPE): lambda: ImageMediaManager,
+    ('reprocess_action', 'image'): reprocess_action,
+    ('media_reprocess', 'image'): media_reprocess,
 }