summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2021-10-05 12:48:57 -0400
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2021-10-05 12:48:57 -0400
commit8e36266d5fc7f9b83f5f5ac30317f75037ae722c (patch)
tree96eda2ae39854cd4c2d611101e7cf8b4fa334755
parentbc64b0cc23da05cc845cc2fb72f04eafa8fa04de (diff)
downloadwfs-8e36266d5fc7f9b83f5f5ac30317f75037ae722c.tar.xz
wfs-8e36266d5fc7f9b83f5f5ac30317f75037ae722c.zip
restrict pillow to png
-rwxr-xr-xwfs.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/wfs.py b/wfs.py
index 0747bec..c107c67 100755
--- a/wfs.py
+++ b/wfs.py
@@ -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}')