only use frombytes, exists for a long time

This commit is contained in:
j 2016-06-16 13:55:29 +02:00
parent 82ddda4fb7
commit 150639ced3

View file

@ -118,15 +118,12 @@ def video(path, height=96, info=None, framerate=FPS):
data = p.stdout.read(nbytes) data = p.stdout.read(nbytes)
if len(data) != nbytes: if len(data) != nbytes:
if first: if first:
raise IOError("ERROR: could not open file %s" % path ) raise IOError("ERROR: could not open file %s" % path)
else: else:
return return
else: else:
first = False first = False
if hasattr(Image, 'fromstring'): yield Image.frombytes('RGB', (width, height), data)
yield Image.fromstring('RGB', (width, height), data)
else:
yield Image.frombytes('RGB', (width, height), data)
def audio(path, info=None, samplerate=48000, framerate=FPS): def audio(path, info=None, samplerate=48000, framerate=FPS):
depth = 2 depth = 2