From 0674be2712d13bff5df549ed7b8b0c13d1fe7925 Mon Sep 17 00:00:00 2001 From: Stefal Date: Tue, 12 Sep 2023 14:56:14 +0200 Subject: [PATCH] fix gpsaltituderef --- download.py | 1 - writer.py | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/download.py b/download.py index f1ce0dc..e7b4cf7 100644 --- a/download.py +++ b/download.py @@ -4,7 +4,6 @@ import os import asyncio import argparse from datetime import datetime -from lib.exif_write import ExifEdit import writer from model import PictureType diff --git a/writer.py b/writer.py index 68821c4..1c83458 100644 --- a/writer.py +++ b/writer.py @@ -82,8 +82,8 @@ def add_altitude(picture: bytes, metadata: PictureMetadata, precision: int = 100 img = pyexiv2.ImageData(picture) updated_exif = {} - if metadata.altitude is not None: - negative_altitude = '0' if altitude >= 0 else '1' + if altitude is not None: + negative_altitude = 0 if altitude >= 0 else 1 updated_exif['Exif.GPSInfo.GPSAltitude'] = f"{int(abs(altitude * precision))} / {precision}" updated_exif['Exif.GPSInfo.GPSAltitudeRef'] = negative_altitude @@ -107,7 +107,6 @@ def add_direction(picture: bytes, metadata: PictureMetadata, ref: str = 'T', pre if updated_exif: img.modify_exif(updated_exif) - print(updated_exif) return img.get_bytes()