diff options
author | dfaker <35278260+dfaker@users.noreply.github.com> | 2019-10-20 17:34:43 +0100 |
---|---|---|
committer | jaseg <githubaccount@jaseg.net> | 2019-11-10 16:11:22 +0100 |
commit | 728e8b2556ee5fc91a504c37c020073e26862258 (patch) | |
tree | 3cba7e7ce8576aec669b5a09148d150ab4589e41 | |
parent | 7117de4005cc470a45efd9cf2e9657bdf63a9079 (diff) | |
download | python-mpv-728e8b2556ee5fc91a504c37c020073e26862258.tar.gz python-mpv-728e8b2556ee5fc91a504c37c020073e26862258.tar.bz2 python-mpv-728e8b2556ee5fc91a504c37c020073e26862258.zip |
Use stride//4 rather than the returned image w
As per discussion on the mpv issue https://github.com/mpv-player/mpv/issues/7076 to handle the screenshot-raw when vf cropping filters are in use.
-rw-r--r-- | mpv.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -683,7 +683,7 @@ class MPV(object): if res['format'] != 'bgr0': raise ValueError('Screenshot in unknown format "{}". Currently, only bgr0 is supported.' .format(res['format'])) - img = Image.frombytes('RGBA', (res['w'], res['h']), res['data']) + img = Image.frombytes('RGBA', (res['stride']//4, res['h']), res['data']) b,g,r,a = img.split() return Image.merge('RGB', (r,g,b)) |