This commit is contained in:
2026-03-18 08:22:26 +01:00
parent c516aaac1d
commit da86f28e4b

29
dzien_02/d_05_exif.py Normal file
View File

@@ -0,0 +1,29 @@
from exif import Image
# otwarcie pliku
def fn_file(file_name):
try:
with open(file_name, mode="rb") as file:
img = Image(file)
return img
except Exception as e:
print(e)
return False
# sprawdzenie danych exif
# 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"
return ret
print(fn_file("images/IMG_123311x.jpg"))
print(fn_file("images/IMG_1233.jpg"))
print(fn_file("to-do.md"))