diff options
author | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2021-10-05 12:48:57 -0400 |
---|---|---|
committer | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2021-10-05 12:48:57 -0400 |
commit | 8e36266d5fc7f9b83f5f5ac30317f75037ae722c (patch) | |
tree | 96eda2ae39854cd4c2d611101e7cf8b4fa334755 | |
parent | bc64b0cc23da05cc845cc2fb72f04eafa8fa04de (diff) | |
download | wfs-8e36266d5fc7f9b83f5f5ac30317f75037ae722c.tar.xz wfs-8e36266d5fc7f9b83f5f5ac30317f75037ae722c.zip |
restrict pillow to png
-rwxr-xr-x | wfs.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -149,14 +149,14 @@ def verify(path, screenshot_begin_png): from io import BytesIO from PIL import Image, ImageChops - screenshot_begin = Image.open(BytesIO(screenshot_begin_png)).convert('RGB') + screenshot_begin = Image.open(BytesIO(screenshot_begin_png), formats=('PNG',)).convert('RGB') logger.info('taking post-screenshot for %s', path) DRIVER.set_window_size(*screenshot_begin.size) screenshot_end_png = DRIVER.get_screenshot_as_png() logger.info('checking screenshot for %s', path) - screenshot_end = Image.open(BytesIO(screenshot_end_png)).convert('RGB') + screenshot_end = Image.open(BytesIO(screenshot_end_png), formats=('PNG',)).convert('RGB') if ImageChops.difference(screenshot_begin, screenshot_end).getbbox(): raise Exception(f'screenshots do not match for {path}') |