Skip to content

Commit ab71c2f

Browse files
authored
fix(android): use double type for GPSHPositioningError tag (#30)
Android ExifInterface expects IFD_FORMAT_URATIONAL for this tag. Using string type caused setAttribute to silently fail on write.
1 parent 8e92ee2 commit ab71c2f

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

android/src/main/java/com/lodev09/exify/ExifyTags.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ val EXIFY_TAGS =
112112
arrayOf("double", ExifInterface.TAG_GPS_DEST_LONGITUDE),
113113
arrayOf("string", ExifInterface.TAG_GPS_DEST_LONGITUDE_REF),
114114
arrayOf("int", ExifInterface.TAG_GPS_DIFFERENTIAL),
115-
arrayOf("string", ExifInterface.TAG_GPS_H_POSITIONING_ERROR),
115+
arrayOf("double", ExifInterface.TAG_GPS_H_POSITIONING_ERROR),
116116
arrayOf("double", ExifInterface.TAG_GPS_IMG_DIRECTION),
117117
arrayOf("string", ExifInterface.TAG_GPS_IMG_DIRECTION_REF),
118118
arrayOf("string", ExifInterface.TAG_GPS_LATITUDE_REF),

example/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default function App() {
5151
GPSTimeStamp: '10:10:10',
5252
GPSDateStamp: '2024:10:10',
5353
GPSDOP: 5.0,
54-
GPSHPositioningError: '10.0',
54+
GPSHPositioningError: 10.0,
5555
GPSImgDirection: 180.5,
5656
GPSImgDirectionRef: 'T',
5757
UserComment: 'Exif updated via @lodev09/react-native-exify',

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface ExifTags {
1515
GPSDifferential?: number;
1616
GPSDestLatitudeRef?: string;
1717
GPSDestDistanceRef?: string;
18-
GPSHPositioningError?: string;
18+
GPSHPositioningError?: number;
1919
GPSDestDistance?: number;
2020
GPSDestBearing?: number;
2121
GPSDateStamp?: string;

0 commit comments

Comments
 (0)