This commit is contained in:
2026-03-18 09:05:36 +01:00
parent da86f28e4b
commit 36c697860a
2 changed files with 26 additions and 13 deletions

BIN
dzien_02/IMG_1233.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

View File

@@ -10,20 +10,33 @@ def fn_file(file_name):
return False
# sprawdzenie danych exif
def file_ok(image):
if image.has_exif:
return True
else:
return False
# wyciagniecie danych
def info(file_name):
ret = f"Info: {file_name} - "
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"
def get_exif(image):
ret = ""
all_data = image.get_all()
klucze = all_data.keys()
if 'lens_model' in klucze:
ret += f" Lens model: {all_data['lens_model']}"
if "make" in klucze:
ret += f" Make: {all_data['make']}"
if "model" in klucze:
ret += f" Model: {all_data['model']}"
return ret
print(fn_file("images/IMG_123311x.jpg"))
print(fn_file("images/IMG_1233.jpg"))
print(fn_file("to-do.md"))
ok = fn_file("IMG_1233.jpg")
if ok:
if file_ok(ok):
print(get_exif(ok))
print(fn_file("to-do.md"))