Don't fail transcoding if we fail to generate a thumbnail.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 2 Jan 2014 17:17:59 +0000 (11:17 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 2 Jan 2014 17:17:59 +0000 (11:17 -0600)
This patch by Sergio Durigan Junior.  Thank you, Sergio!

AUTHORS
mediagoblin/media_types/video/processing.py

diff --git a/AUTHORS b/AUTHORS
index d1b082e096d8508ad79bc8fc0243e41594a3afc5..2b2bb48a4ba69be591804dd0c9b58a18d67b96a8 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -82,6 +82,7 @@ Thank you!
 * Tran Thanh Bao
 * Tryggvi Björgvinsson
 * Shawn Khan
+* Sergio Durigan Junior
 * Will Kahn-Greene
 
 Special thanks to:
index eb5a062cf729d28e130be3f22e04011079a28a6a..abd5f36e0bc84b0ed506d0c12570ebdf82346918 100644 (file)
@@ -266,6 +266,11 @@ class CommonVideoProcessor(MediaProcessor):
             tmp_thumb,
             thumb_size[0])
 
+        # Checking if the thumbnail was correctly created.  If it was not,
+        # then just give up.
+        if not os.path.exists (tmp_thumb):
+            return
+
         # Push the thumbnail to public storage
         _log.debug('Saving thumbnail...')
         store_public(self.entry, 'thumb', tmp_thumb,