exif
This commit is contained in:
BIN
dzien_02/IMG_1233.jpg
Normal file
BIN
dzien_02/IMG_1233.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 MiB |
@@ -10,20 +10,33 @@ def fn_file(file_name):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
# sprawdzenie danych exif
|
# sprawdzenie danych exif
|
||||||
|
def file_ok(image):
|
||||||
|
if image.has_exif:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
# wyciagniecie danych
|
# wyciagniecie danych
|
||||||
|
def get_exif(image):
|
||||||
def info(file_name):
|
ret = ""
|
||||||
ret = f"Info: {file_name} - "
|
all_data = image.get_all()
|
||||||
try:
|
klucze = all_data.keys()
|
||||||
with open(file_name, mode="rb") as file:
|
if 'lens_model' in klucze:
|
||||||
img_bin = Image(file)
|
ret += f" Lens model: {all_data['lens_model']}"
|
||||||
dane = img_bin.get_all()
|
if "make" in klucze:
|
||||||
ret += str(dane)
|
ret += f" Make: {all_data['make']}"
|
||||||
except:
|
if "model" in klucze:
|
||||||
ret += "Bład pliku"
|
ret += f" Model: {all_data['model']}"
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print(fn_file("images/IMG_123311x.jpg"))
|
print(fn_file("images/IMG_123311x.jpg"))
|
||||||
print(fn_file("images/IMG_1233.jpg"))
|
|
||||||
|
ok = fn_file("IMG_1233.jpg")
|
||||||
|
if ok:
|
||||||
|
if file_ok(ok):
|
||||||
|
print(get_exif(ok))
|
||||||
|
|
||||||
print(fn_file("to-do.md"))
|
print(fn_file("to-do.md"))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user