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
1 changed files with 2 additions and 5 deletions

View File

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