media_types/sniff_media: reset file back to 0 offset for actual copy. Required when...
authorAlon Levy <alon@pobox.com>
Fri, 27 Dec 2013 01:00:02 +0000 (19:00 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Fri, 27 Dec 2013 01:00:02 +0000 (19:00 -0600)
mediagoblin/media_types/__init__.py

index 80ae633ba47c0f2d630afca4ac2bf61995b75c35..2e392317e02f9d33958e887102f6b9224cee87fb 100644 (file)
@@ -65,6 +65,7 @@ def sniff_media(media_file, filename):
         tmp_media_file = tempfile.NamedTemporaryFile()
         tmp_media_file.write(media_file.read())
         tmp_media_file.seek(0)
+        media_file.seek(0)
 
         media_type = hook_handle('sniff_handler', tmp_media_file, filename)
         if media_type: