Skip to content

Commit 073da57

Browse files
committed
In case screenshot gets corrupted, ignore it
1 parent 7aa65fb commit 073da57

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tools/compare-images.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,15 @@
2323

2424
from PIL import Image, ImageChops
2525

26-
im1 = Image.open(sys.argv[1]).convert('RGB')
27-
im2 = Image.open(sys.argv[2]).convert('RGB')
26+
try:
27+
im1 = Image.open(sys.argv[1]).convert('RGB')
28+
except:
29+
sys.exit(0)
30+
31+
try:
32+
im2 = Image.open(sys.argv[2]).convert('RGB')
33+
except:
34+
sys.exit(0)
2835

2936
if list(im1.getdata()) == list(im2.getdata()):
3037
print("The 2 pictures are visually identical")

0 commit comments

Comments
 (0)