Fix Issue 5375 Deprecated function in video thumb
authorayleph <ayleph@thisshitistemp.com>
Fri, 18 Dec 2015 02:06:42 +0000 (21:06 -0500)
committerBoris Bobrov <breton@cynicmansion.ru>
Sat, 19 Dec 2015 21:51:13 +0000 (00:51 +0300)
This patch fixes issue 5375 by replacing a function call that has
been removed in recent versions of PIL with the recommended
replacement.

(cherry picked from commit 564a48e018bcd786aa32b232cb7216be3ef3fb5e)

mediagoblin/media_types/video/transcoders.py

index 57912c54005ff5b7ec43bddbd62c4a751452c633..f8020497a28fa0fa892f63e39dfaa7ae2fc1bad4 100644 (file)
@@ -132,7 +132,7 @@ def capture_thumb(video_path, dest_path, width=None, height=None, percent=0.5):
     buffer = sample.get_buffer()
 
     # get the image from the buffer and save it to disk
-    im = Image.fromstring('RGB', (width, height),
+    im = Image.frombytes('RGB', (width, height),
                          buffer.extract_dup(0, buffer.get_size()))
     im.save(dest_path)
     _log.info('thumbnail saved to {0}'.format(dest_path))