From 5f330078bf835e8faee9f7c46417998bac974765 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Sat, 4 Nov 2023 20:16:37 -0600 Subject: [PATCH] fix png check failing --- pkg/image.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/image.py b/pkg/image.py index 2a9b9d6..ea778fc 100644 --- a/pkg/image.py +++ b/pkg/image.py @@ -17,5 +17,8 @@ def is_png(file_path): :param file_path: :return: """ - img = Image.open(file_path) - return img.format == 'PNG' + try: + img = Image.open(file_path) + return img.format == 'PNG' + except: + return False