Various build fixes, cleanup and details #6
|
@ -108,11 +108,13 @@ def process_video(path, *, maxsize, quality):
|
|||
img = frame.to_image()
|
||||
del frame, stream
|
||||
|
||||
img.thumbnail((maxsize, maxsize))
|
||||
imgdata = io.BytesIO()
|
||||
if rotation:
|
||||
img = img.rotate(rotation, expand=True)
|
||||
img.save(imgdata, format="webp", quality=quality, method=4)
|
||||
img.thumbnail((maxsize, maxsize))
|
||||
imgdata = io.BytesIO()
|
||||
if rotation:
|
||||
img = img.rotate(rotation, expand=True)
|
||||
img.save(imgdata, format="webp", quality=quality, method=4)
|
||||
del img
|
||||
|
||||
ret = imgdata.getvalue()
|
||||
gc.collect()
|
||||
return ret
|
||||
|
|
Loading…
Reference in New Issue
Block a user