From f6fc816a4c0205c48d955fbcaa3c0919f6ba0113 Mon Sep 17 00:00:00 2001 From: lodev09 Date: Wed, 18 Feb 2026 00:10:31 +0800 Subject: [PATCH] fix(android): use double type for GPSHPositioningError tag Android ExifInterface expects IFD_FORMAT_URATIONAL for this tag. Using string type caused setAttribute to silently fail on write. --- android/src/main/java/com/lodev09/exify/ExifyTags.kt | 2 +- example/src/App.tsx | 2 +- src/types.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/android/src/main/java/com/lodev09/exify/ExifyTags.kt b/android/src/main/java/com/lodev09/exify/ExifyTags.kt index 5e6eaed..7535e9d 100644 --- a/android/src/main/java/com/lodev09/exify/ExifyTags.kt +++ b/android/src/main/java/com/lodev09/exify/ExifyTags.kt @@ -112,7 +112,7 @@ val EXIFY_TAGS = arrayOf("double", ExifInterface.TAG_GPS_DEST_LONGITUDE), arrayOf("string", ExifInterface.TAG_GPS_DEST_LONGITUDE_REF), arrayOf("int", ExifInterface.TAG_GPS_DIFFERENTIAL), - arrayOf("string", ExifInterface.TAG_GPS_H_POSITIONING_ERROR), + arrayOf("double", ExifInterface.TAG_GPS_H_POSITIONING_ERROR), arrayOf("double", ExifInterface.TAG_GPS_IMG_DIRECTION), arrayOf("string", ExifInterface.TAG_GPS_IMG_DIRECTION_REF), arrayOf("string", ExifInterface.TAG_GPS_LATITUDE_REF), diff --git a/example/src/App.tsx b/example/src/App.tsx index 5ba57d6..097209b 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -51,7 +51,7 @@ export default function App() { GPSTimeStamp: '10:10:10', GPSDateStamp: '2024:10:10', GPSDOP: 5.0, - GPSHPositioningError: '10.0', + GPSHPositioningError: 10.0, GPSImgDirection: 180.5, GPSImgDirectionRef: 'T', UserComment: 'Exif updated via @lodev09/react-native-exify', diff --git a/src/types.ts b/src/types.ts index faf510c..7e415b5 100644 --- a/src/types.ts +++ b/src/types.ts @@ -15,7 +15,7 @@ export interface ExifTags { GPSDifferential?: number; GPSDestLatitudeRef?: string; GPSDestDistanceRef?: string; - GPSHPositioningError?: string; + GPSHPositioningError?: number; GPSDestDistance?: number; GPSDestBearing?: number; GPSDateStamp?: string;