This commit is contained in:
2025-12-18 10:40:08 +01:00
parent f2754cba35
commit 321a7e5b39
21 changed files with 1569 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
import os
import cv2
from exif import Image
file_name = "adam.jpg"
if not os.path.exists(file_name):
print(f"Brak pliku: {file_name}")
# kod błedu na podstawie https://questdb.com/docs/troubleshooting/os-error-codes/
exit(5)
with open(file_name, 'rb') as image_file:
image = Image(image_file)
print(image.list_all())
# czytamy plik
flags = cv2.IMREAD_COLOR
img = cv2.imread(file_name, flags)
print(f"Rozmiary obrazka to: {img.shape=}")
rozmiary_exif = f"""
Wymiary to {image.x_resolution} x {image.y_resolution}
Unit {image.resolution_unit=}
"""
print(rozmiary_exif)
cv2.imshow("nazwa okienka", img)
cv2.waitKey(0)
cv2.destroyAllWindows()