From 8b89ddd63fe03f7d42f125c30c96314e4f5c16ae Mon Sep 17 00:00:00 2001 From: TrevorBurgoyne Date: Fri, 27 Feb 2026 09:03:16 -0600 Subject: [PATCH 1/2] Add dewarp flag support from imgparser --- S3MP/utils/image_utils.py | 9 +++++++++ pyproject.toml | 2 +- uv.lock | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/S3MP/utils/image_utils.py b/S3MP/utils/image_utils.py index f79ae08..450c27c 100644 --- a/S3MP/utils/image_utils.py +++ b/S3MP/utils/image_utils.py @@ -24,6 +24,7 @@ def __init__( focal_length: float | None = None, altitude: float | None = None, distortion_params: DistortionParams | None = None, + dewarp_flag: bool = False, ): """Initialize ImageMetadata object. @@ -36,6 +37,7 @@ def __init__( rotation: Euler angles (roll, pitch, yaw) if available focal_length: Focal length in pixels if available altitude: Altitude in meters if available + dewarp_flag: Flag indicating if image should be dewarped based on metadata distortion_params: Distortion parameters if available """ self.mirror_path = mirror_path @@ -63,6 +65,7 @@ def __init__( self.focal_length = focal_length self.altitude = altitude self.distortion_params = distortion_params + self.dewarp_flag = dewarp_flag @classmethod def parse_metadata(cls, mirror_path: MirrorPath) -> ImageMetadata: @@ -84,6 +87,11 @@ def parse_metadata(cls, mirror_path: MirrorPath) -> ImageMetadata: except Exception: distortion_params = None + try: + dewarp_flag = parser.dewarp_flag() + except KeyError: + dewarp_flag = False + return cls( mirror_path, parser.dimensions(), @@ -94,6 +102,7 @@ def parse_metadata(cls, mirror_path: MirrorPath) -> ImageMetadata: parser.focal_length_pixels(), parser.relative_altitude(), distortion_params, + dewarp_flag, ) @property diff --git a/pyproject.toml b/pyproject.toml index c45d305..4b34468 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "S3MP" -version = "0.8.0" +version = "0.8.1" description = "" authors = [ {name = "Joshua Dean", email = "joshua.dean@sentera.com"}, diff --git a/uv.lock b/uv.lock index d8ee49a..b6eb775 100644 --- a/uv.lock +++ b/uv.lock @@ -1515,7 +1515,7 @@ wheels = [ [[package]] name = "s3mp" -version = "0.8.0" +version = "0.8.1" source = { editable = "." } dependencies = [ { name = "aioboto3" }, From bf47ffe2472baddf3bc77eb93a232c16e16c8f16 Mon Sep 17 00:00:00 2001 From: Trevor Burgoyne <82477095+TrevorBurgoyne@users.noreply.github.com> Date: Fri, 27 Feb 2026 09:58:40 -0600 Subject: [PATCH 2/2] Update S3MP/utils/image_utils.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- S3MP/utils/image_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/S3MP/utils/image_utils.py b/S3MP/utils/image_utils.py index 450c27c..15396d8 100644 --- a/S3MP/utils/image_utils.py +++ b/S3MP/utils/image_utils.py @@ -37,8 +37,8 @@ def __init__( rotation: Euler angles (roll, pitch, yaw) if available focal_length: Focal length in pixels if available altitude: Altitude in meters if available - dewarp_flag: Flag indicating if image should be dewarped based on metadata distortion_params: Distortion parameters if available + dewarp_flag: Flag indicating if image should be dewarped based on metadata """ self.mirror_path = mirror_path self.name = self.mirror_path.local_path.stem