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.
This commit is contained in:
Christopher Allan Webber 2015-05-22 14:16:45 -05:00
parent c2382bd4ea
commit 5b8e0b2a63

View 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.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))