only use frombytes, exists for a long time
This commit is contained in:
parent
82ddda4fb7
commit
150639ced3
1 changed files with 2 additions and 5 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue