From ead89ae1d9cd145d50087c6928afe0f09640a26b Mon Sep 17 00:00:00 2001 From: Adam Jurkiewicz Pythonista Local Date: Tue, 17 Mar 2026 15:07:37 +0100 Subject: [PATCH] exif --- dzien_01/d_05_exif.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dzien_01/d_05_exif.py b/dzien_01/d_05_exif.py index 4b06b5c..96b979b 100644 --- a/dzien_01/d_05_exif.py +++ b/dzien_01/d_05_exif.py @@ -2,12 +2,13 @@ from exif import Image def info(file_name): ret = f"Info: {file_name} - " - with open(file_name, mode="rb") as file: - img_bin = Image(file) - dane = img_bin.get_all() - ret += str(dane) + try: + with open(file_name, mode="rb") as file: + img_bin = Image(file) + dane = img_bin.get_all() + ret += str(dane) + except: + ret += "Bład pliku" return ret -print( - info("images/IMG_12330.jpg") -) \ No newline at end of file +print(info("images/IMG_123311x.jpg")) \ No newline at end of file