From 5b8e0b2a63194d53da2ce434e867fc5eab1b60b4 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Fri, 22 May 2015 14:16:45 -0500 Subject: [PATCH] Use of deprecated frombytes when processing videos causes the task to fail (Anonymous contribution, not by me) When transcoding a video using a recent version of PIL transcoding a video fails reproducible. The reason for this is an AttributeError: 'module' object has no attribute 'frombytes'gets raised, while a thumbnails is being created. This is because frombytes alias was deprecated in favor of fromstring. --- mediagoblin/media_types/video/transcoders.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediagoblin/media_types/video/transcoders.py b/mediagoblin/media_types/video/transcoders.py index ba469af2..6e0b702b 100644 --- a/mediagoblin/media_types/video/transcoders.py +++ b/mediagoblin/media_types/video/transcoders.py @@ -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.frombytes('RGB', (width, height), + im = Image.fromstring('RGB', (width, height), buffer.extract_dup(0, buffer.get_size())) im.save(dest_path) _log.info('thumbnail saved to {0}'.format(dest_path)) -- 2.11.4.GIT