Explicitly *do not* handle NEF files via the video media type.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 17 Jul 2014 20:04:03 +0000 (15:04 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 17 Jul 2014 20:04:03 +0000 (15:04 -0500)
Gstreamer might think it's a good idea, but it isn't.

mediagoblin/media_types/video/processing.py

index 454f4ac47d5098404b7a38492799f89cee05b04e..c21c74b3ac7c9e9c371cc40794cef47654041b5f 100644 (file)
@@ -44,7 +44,16 @@ class VideoTranscodingFail(BaseProcessingFail):
     general_message = _(u'Video transcoding failed')
 
 
+EXCLUDED_EXTS = ["nef"]
+
 def sniff_handler(media_file, filename):
+    name, ext = os.path.splitext(filename)
+    clean_ext = ext.lower()[1:]
+
+    if clean_ext in EXCLUDED_EXTS:
+        # We don't handle this filetype, though gstreamer might think we can
+        return None
+
     transcoder = transcoders.VideoTranscoder()
     data = transcoder.discover(media_file.name)