diff options
| author | Tim Keller <tjkeller.xyz> | 2025-05-09 22:04:15 -0500 |
|---|---|---|
| committer | Tim Keller <tjkeller.xyz> | 2025-05-09 22:04:15 -0500 |
| commit | 568a87f44a674276e6e55f9302cc9e44a0929f71 (patch) | |
| tree | 849378c6507dab943de29f47ff1ada45edc861bf | |
| parent | 145de3311cb9f32ac0bc9842b0600fcad84fed16 (diff) | |
| download | immich-frame-568a87f44a674276e6e55f9302cc9e44a0929f71.tar.xz immich-frame-568a87f44a674276e6e55f9302cc9e44a0929f71.zip | |
get exif correctly
| -rw-r--r-- | texture.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -8,7 +8,7 @@ class ImageTexture: self.id = None img = Image.open(image_source) self.exif = exif or ImageTexture.get_exif(img) - img = ImageTexture.handle_orientation(img, exif) + img = ImageTexture.handle_orientation(img, self.exif) img = img.convert("RGBA") # Ensure the image is in RGBA mode self.width = img.width self.height = img.height @@ -30,11 +30,11 @@ class ImageTexture: @staticmethod def get_exif(img): - return { ExifTags.TAGS[k]: v for k, v in img.getexif().items() if k in ExifTags } + return { ExifTags.TAGS[k]: v for k, v in img.getexif().items() if k in ExifTags.TAGS } @staticmethod def handle_orientation(img, exif): - orientation = exif.get("Orientation", 1) + orientation = exif.get("Orientation", 1) if exif is not None else 1 if orientation == 3: return img.rotate(180, expand=True) if orientation == 6: return img.rotate(270, expand=True) |
