[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GMG-Devel] [PATCH] Do not fail if thumbnail was not created (fix for ti
Sergio Durigan Junior
[GMG-Devel] [PATCH] Do not fail if thumbnail was not created (fix for ticket #757)
Sun, 15 Dec 2013 14:23:35 -0200
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)
This simple patch came out of a discussion in the #mediagoblin channel.
Tran Thanh Bao helped me with most of the investigation, and Christopher
Webber suggested a way to improve the workaround found by Tran. So I
went ahead and did what was proposed.
The problem is that I was unable to upload some kinds of formats (video
and audio) to my MG instance. I was seeing the same error as
<https://issues.mediagoblin.org/ticket/757>, i.e., "Copying to public
storage failed.". After a good deal of time spent in the investigation
of the issue, Tran found that the problem happened when MG tried to
generated the thumbnail of the video. Specifically, gstreamer was
failing badly, but MG still assumed that the thumbnail was generated
correctly and tried to copy the (non-existent) file to another folder,
which lead to the error mentioned above.
The proposed fix is simple. I just checked for the existence of the
thumbnail file (after the thumbnailing process was called), and if
nothing was found, the function just gives up (and thus uses the default
thumb image). It is now working fine for me, for all the formats I have
OK to apply? Thanks.
diff --git a/mediagoblin/media_types/video/processing.py
index eb5a062..abd5f36 100644
@@ -266,6 +266,11 @@ class CommonVideoProcessor(MediaProcessor):
+ # Checking if the thumbnail was correctly created. If it was not,
+ # then just give up.
+ if not os.path.exists (tmp_thumb):
# Push the thumbnail to public storage
store_public(self.entry, 'thumb', tmp_thumb,
|[Prev in Thread]
||[Next in Thread]|
- [GMG-Devel] [PATCH] Do not fail if thumbnail was not created (fix for ticket #757),
Sergio Durigan Junior <=