@lodev09/react-native-exify 0.2.7 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/Exify.podspec +3 -23
  2. package/LICENSE +1 -1
  3. package/README.md +44 -18
  4. package/android/build.gradle +26 -53
  5. package/android/src/main/AndroidManifest.xml +2 -2
  6. package/android/src/main/java/com/lodev09/exify/ExifyModule.kt +146 -32
  7. package/android/src/main/java/com/lodev09/exify/ExifyPackage.kt +28 -10
  8. package/android/src/main/java/com/lodev09/exify/ExifyTags.kt +137 -135
  9. package/android/src/main/java/com/lodev09/exify/ExifyUtils.kt +31 -8
  10. package/ios/Exify.h +9 -0
  11. package/ios/Exify.mm +384 -25
  12. package/lib/module/index.js +12 -22
  13. package/lib/module/index.js.map +1 -1
  14. package/lib/module/package.json +1 -0
  15. package/lib/module/specs/NativeExifyModule.js +5 -0
  16. package/lib/module/specs/NativeExifyModule.js.map +1 -0
  17. package/lib/module/types.js +1 -1
  18. package/lib/typescript/package.json +1 -0
  19. package/lib/typescript/src/index.d.ts +7 -9
  20. package/lib/typescript/src/index.d.ts.map +1 -1
  21. package/lib/typescript/src/specs/NativeExifyModule.d.ts +8 -0
  22. package/lib/typescript/src/specs/NativeExifyModule.d.ts.map +1 -0
  23. package/lib/typescript/src/types.d.ts +2 -1
  24. package/lib/typescript/src/types.d.ts.map +1 -1
  25. package/package.json +82 -95
  26. package/src/index.ts +12 -31
  27. package/src/specs/NativeExifyModule.ts +8 -0
  28. package/src/types.ts +141 -140
  29. package/android/gradle.properties +0 -5
  30. package/android/src/main/AndroidManifestNew.xml +0 -2
  31. package/ios/Exify-Bridging-Header.h +0 -11
  32. package/ios/Exify.swift +0 -134
  33. package/ios/ExifyUtils.swift +0 -140
  34. package/lib/commonjs/index.js +0 -53
  35. package/lib/commonjs/index.js.map +0 -1
  36. package/lib/commonjs/types.js +0 -2
  37. package/lib/commonjs/types.js.map +0 -1
@@ -1,142 +1,144 @@
1
1
  package com.lodev09.exify
2
+
2
3
  import androidx.exifinterface.media.ExifInterface
3
4
 
4
5
  /**
5
6
  * Supported Exif Tags
6
7
  * Note: Latitude, Longitude and Altitude tags are updated separately
7
8
  */
8
- val EXIFY_TAGS = arrayOf(
9
- arrayOf("string", ExifInterface.TAG_ARTIST),
10
- arrayOf("int", ExifInterface.TAG_BITS_PER_SAMPLE),
11
- arrayOf("int", ExifInterface.TAG_COMPRESSION),
12
- arrayOf("string", ExifInterface.TAG_COPYRIGHT),
13
- arrayOf("string", ExifInterface.TAG_DATETIME),
14
- arrayOf("string", ExifInterface.TAG_IMAGE_DESCRIPTION),
15
- arrayOf("int", ExifInterface.TAG_IMAGE_LENGTH),
16
- arrayOf("int", ExifInterface.TAG_IMAGE_WIDTH),
17
- arrayOf("int", ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT),
18
- arrayOf("int", ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT_LENGTH),
19
- arrayOf("string", ExifInterface.TAG_MAKE),
20
- arrayOf("string", ExifInterface.TAG_MODEL),
21
- arrayOf("int", ExifInterface.TAG_ORIENTATION),
22
- arrayOf("int", ExifInterface.TAG_PHOTOMETRIC_INTERPRETATION),
23
- arrayOf("int", ExifInterface.TAG_PLANAR_CONFIGURATION),
24
- arrayOf("double", ExifInterface.TAG_PRIMARY_CHROMATICITIES),
25
- arrayOf("double", ExifInterface.TAG_REFERENCE_BLACK_WHITE),
26
- arrayOf("int", ExifInterface.TAG_RESOLUTION_UNIT),
27
- arrayOf("int", ExifInterface.TAG_ROWS_PER_STRIP),
28
- arrayOf("int", ExifInterface.TAG_SAMPLES_PER_PIXEL),
29
- arrayOf("string", ExifInterface.TAG_SOFTWARE),
30
- arrayOf("int", ExifInterface.TAG_STRIP_BYTE_COUNTS),
31
- arrayOf("int", ExifInterface.TAG_STRIP_OFFSETS),
32
- arrayOf("int", ExifInterface.TAG_TRANSFER_FUNCTION),
33
- arrayOf("double", ExifInterface.TAG_WHITE_POINT),
34
- arrayOf("double", ExifInterface.TAG_X_RESOLUTION),
35
- arrayOf("double", ExifInterface.TAG_Y_CB_CR_COEFFICIENTS),
36
- arrayOf("int", ExifInterface.TAG_Y_CB_CR_POSITIONING),
37
- arrayOf("int", ExifInterface.TAG_Y_CB_CR_SUB_SAMPLING),
38
- arrayOf("double", ExifInterface.TAG_Y_RESOLUTION),
39
- arrayOf("double", ExifInterface.TAG_APERTURE_VALUE),
40
- arrayOf("double", ExifInterface.TAG_BRIGHTNESS_VALUE),
41
- arrayOf("string", ExifInterface.TAG_CFA_PATTERN),
42
- arrayOf("int", ExifInterface.TAG_COLOR_SPACE),
43
- arrayOf("array", ExifInterface.TAG_COMPONENTS_CONFIGURATION),
44
- arrayOf("double", ExifInterface.TAG_COMPRESSED_BITS_PER_PIXEL),
45
- arrayOf("int", ExifInterface.TAG_CONTRAST),
46
- arrayOf("int", ExifInterface.TAG_CUSTOM_RENDERED),
47
- arrayOf("string", ExifInterface.TAG_DATETIME_DIGITIZED),
48
- arrayOf("string", ExifInterface.TAG_DATETIME_ORIGINAL),
49
- arrayOf("string", ExifInterface.TAG_DEVICE_SETTING_DESCRIPTION),
50
- arrayOf("double", ExifInterface.TAG_DIGITAL_ZOOM_RATIO),
51
- arrayOf("array", ExifInterface.TAG_EXIF_VERSION),
52
- arrayOf("double", ExifInterface.TAG_EXPOSURE_BIAS_VALUE),
53
- arrayOf("double", ExifInterface.TAG_EXPOSURE_INDEX),
54
- arrayOf("int", ExifInterface.TAG_EXPOSURE_MODE),
55
- arrayOf("int", ExifInterface.TAG_EXPOSURE_PROGRAM),
56
- arrayOf("double", ExifInterface.TAG_EXPOSURE_TIME),
57
- arrayOf("double", ExifInterface.TAG_F_NUMBER),
58
- arrayOf("string", ExifInterface.TAG_FILE_SOURCE),
59
- arrayOf("int", ExifInterface.TAG_FLASH),
60
- arrayOf("double", ExifInterface.TAG_FLASH_ENERGY),
61
- arrayOf("array", ExifInterface.TAG_FLASHPIX_VERSION),
62
- arrayOf("double", ExifInterface.TAG_FOCAL_LENGTH),
63
- arrayOf("string", ExifInterface.TAG_LENS_MAKE),
64
- arrayOf("string", ExifInterface.TAG_LENS_MODEL),
65
- arrayOf("array", ExifInterface.TAG_LENS_SPECIFICATION),
66
- arrayOf("int", ExifInterface.TAG_FOCAL_LENGTH_IN_35MM_FILM),
67
- arrayOf("int", ExifInterface.TAG_FOCAL_PLANE_RESOLUTION_UNIT),
68
- arrayOf("double", ExifInterface.TAG_FOCAL_PLANE_X_RESOLUTION),
69
- arrayOf("double", ExifInterface.TAG_FOCAL_PLANE_Y_RESOLUTION),
70
- arrayOf("int", ExifInterface.TAG_GAIN_CONTROL),
71
- arrayOf("array", ExifInterface.TAG_ISO_SPEED_RATINGS),
72
- arrayOf("string", ExifInterface.TAG_IMAGE_UNIQUE_ID),
73
- arrayOf("int", ExifInterface.TAG_LIGHT_SOURCE),
74
- arrayOf("string", ExifInterface.TAG_MAKER_NOTE),
75
- arrayOf("double", ExifInterface.TAG_MAX_APERTURE_VALUE),
76
- arrayOf("int", ExifInterface.TAG_METERING_MODE),
77
- arrayOf("int", ExifInterface.TAG_NEW_SUBFILE_TYPE),
78
- arrayOf("string", ExifInterface.TAG_OECF),
79
- arrayOf("int", ExifInterface.TAG_PIXEL_X_DIMENSION),
80
- arrayOf("int", ExifInterface.TAG_PIXEL_Y_DIMENSION),
81
- arrayOf("string", ExifInterface.TAG_RELATED_SOUND_FILE),
82
- arrayOf("int", ExifInterface.TAG_SATURATION),
83
- arrayOf("int", ExifInterface.TAG_SCENE_CAPTURE_TYPE),
84
- arrayOf("string", ExifInterface.TAG_SCENE_TYPE),
85
- arrayOf("int", ExifInterface.TAG_SENSING_METHOD),
86
- arrayOf("int", ExifInterface.TAG_SHARPNESS),
87
- arrayOf("double", ExifInterface.TAG_SHUTTER_SPEED_VALUE),
88
- arrayOf("string", ExifInterface.TAG_SPATIAL_FREQUENCY_RESPONSE),
89
- arrayOf("string", ExifInterface.TAG_SPECTRAL_SENSITIVITY),
90
- arrayOf("int", ExifInterface.TAG_SUBFILE_TYPE),
91
- arrayOf("string", ExifInterface.TAG_SUBSEC_TIME),
92
- arrayOf("string", ExifInterface.TAG_SUBSEC_TIME_DIGITIZED),
93
- arrayOf("string", ExifInterface.TAG_SUBSEC_TIME_ORIGINAL),
94
- arrayOf("array", ExifInterface.TAG_SUBJECT_AREA),
95
- arrayOf("double", ExifInterface.TAG_SUBJECT_DISTANCE),
96
- arrayOf("int", ExifInterface.TAG_SUBJECT_DISTANCE_RANGE),
97
- arrayOf("int", ExifInterface.TAG_SUBJECT_LOCATION),
98
- arrayOf("string", ExifInterface.TAG_USER_COMMENT),
99
- arrayOf("int", ExifInterface.TAG_WHITE_BALANCE),
100
- arrayOf("int", ExifInterface.TAG_GPS_ALTITUDE_REF),
101
- arrayOf("string", ExifInterface.TAG_GPS_AREA_INFORMATION),
102
- arrayOf("double", ExifInterface.TAG_GPS_DOP),
103
- arrayOf("string", ExifInterface.TAG_GPS_DATESTAMP),
104
- arrayOf("double", ExifInterface.TAG_GPS_DEST_BEARING),
105
- arrayOf("string", ExifInterface.TAG_GPS_DEST_BEARING_REF),
106
- arrayOf("double", ExifInterface.TAG_GPS_DEST_DISTANCE),
107
- arrayOf("string", ExifInterface.TAG_GPS_DEST_DISTANCE_REF),
108
- arrayOf("double", ExifInterface.TAG_GPS_DEST_LATITUDE),
109
- arrayOf("string", ExifInterface.TAG_GPS_DEST_LATITUDE_REF),
110
- arrayOf("double", ExifInterface.TAG_GPS_DEST_LONGITUDE),
111
- arrayOf("string", ExifInterface.TAG_GPS_DEST_LONGITUDE_REF),
112
- arrayOf("int", ExifInterface.TAG_GPS_DIFFERENTIAL),
113
- arrayOf("string", ExifInterface.TAG_GPS_H_POSITIONING_ERROR),
114
- arrayOf("double", ExifInterface.TAG_GPS_IMG_DIRECTION),
115
- arrayOf("string", ExifInterface.TAG_GPS_IMG_DIRECTION_REF),
116
- arrayOf("string", ExifInterface.TAG_GPS_LATITUDE_REF),
117
- arrayOf("string", ExifInterface.TAG_GPS_LONGITUDE_REF),
118
- arrayOf("string", ExifInterface.TAG_GPS_MAP_DATUM),
119
- arrayOf("string", ExifInterface.TAG_GPS_MEASURE_MODE),
120
- arrayOf("string", ExifInterface.TAG_GPS_PROCESSING_METHOD),
121
- arrayOf("string", ExifInterface.TAG_GPS_SATELLITES),
122
- arrayOf("double", ExifInterface.TAG_GPS_SPEED),
123
- arrayOf("string", ExifInterface.TAG_GPS_SPEED_REF),
124
- arrayOf("string", ExifInterface.TAG_GPS_STATUS),
125
- arrayOf("string", ExifInterface.TAG_GPS_TIMESTAMP),
126
- arrayOf("double", ExifInterface.TAG_GPS_TRACK),
127
- arrayOf("string", ExifInterface.TAG_GPS_TRACK_REF),
128
- arrayOf("string", ExifInterface.TAG_GPS_VERSION_ID),
129
- arrayOf("string", ExifInterface.TAG_INTEROPERABILITY_INDEX),
130
- arrayOf("int", ExifInterface.TAG_THUMBNAIL_IMAGE_LENGTH),
131
- arrayOf("int", ExifInterface.TAG_THUMBNAIL_IMAGE_WIDTH),
132
- arrayOf("int", ExifInterface.TAG_DNG_VERSION),
133
- arrayOf("int", ExifInterface.TAG_DEFAULT_CROP_SIZE),
134
- arrayOf("int", ExifInterface.TAG_ORF_PREVIEW_IMAGE_START),
135
- arrayOf("int", ExifInterface.TAG_ORF_PREVIEW_IMAGE_LENGTH),
136
- arrayOf("int", ExifInterface.TAG_ORF_ASPECT_FRAME),
137
- arrayOf("int", ExifInterface.TAG_RW2_SENSOR_BOTTOM_BORDER),
138
- arrayOf("int", ExifInterface.TAG_RW2_SENSOR_LEFT_BORDER),
139
- arrayOf("int", ExifInterface.TAG_RW2_SENSOR_RIGHT_BORDER),
140
- arrayOf("int", ExifInterface.TAG_RW2_SENSOR_TOP_BORDER),
141
- arrayOf("int", ExifInterface.TAG_RW2_ISO)
142
- )
9
+ val EXIFY_TAGS =
10
+ arrayOf(
11
+ arrayOf("string", ExifInterface.TAG_ARTIST),
12
+ arrayOf("int", ExifInterface.TAG_BITS_PER_SAMPLE),
13
+ arrayOf("int", ExifInterface.TAG_COMPRESSION),
14
+ arrayOf("string", ExifInterface.TAG_COPYRIGHT),
15
+ arrayOf("string", ExifInterface.TAG_DATETIME),
16
+ arrayOf("string", ExifInterface.TAG_IMAGE_DESCRIPTION),
17
+ arrayOf("int", ExifInterface.TAG_IMAGE_LENGTH),
18
+ arrayOf("int", ExifInterface.TAG_IMAGE_WIDTH),
19
+ arrayOf("int", ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT),
20
+ arrayOf("int", ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT_LENGTH),
21
+ arrayOf("string", ExifInterface.TAG_MAKE),
22
+ arrayOf("string", ExifInterface.TAG_MODEL),
23
+ arrayOf("int", ExifInterface.TAG_ORIENTATION),
24
+ arrayOf("int", ExifInterface.TAG_PHOTOMETRIC_INTERPRETATION),
25
+ arrayOf("int", ExifInterface.TAG_PLANAR_CONFIGURATION),
26
+ arrayOf("double", ExifInterface.TAG_PRIMARY_CHROMATICITIES),
27
+ arrayOf("double", ExifInterface.TAG_REFERENCE_BLACK_WHITE),
28
+ arrayOf("int", ExifInterface.TAG_RESOLUTION_UNIT),
29
+ arrayOf("int", ExifInterface.TAG_ROWS_PER_STRIP),
30
+ arrayOf("int", ExifInterface.TAG_SAMPLES_PER_PIXEL),
31
+ arrayOf("string", ExifInterface.TAG_SOFTWARE),
32
+ arrayOf("int", ExifInterface.TAG_STRIP_BYTE_COUNTS),
33
+ arrayOf("int", ExifInterface.TAG_STRIP_OFFSETS),
34
+ arrayOf("int", ExifInterface.TAG_TRANSFER_FUNCTION),
35
+ arrayOf("double", ExifInterface.TAG_WHITE_POINT),
36
+ arrayOf("double", ExifInterface.TAG_X_RESOLUTION),
37
+ arrayOf("double", ExifInterface.TAG_Y_CB_CR_COEFFICIENTS),
38
+ arrayOf("int", ExifInterface.TAG_Y_CB_CR_POSITIONING),
39
+ arrayOf("int", ExifInterface.TAG_Y_CB_CR_SUB_SAMPLING),
40
+ arrayOf("double", ExifInterface.TAG_Y_RESOLUTION),
41
+ arrayOf("double", ExifInterface.TAG_APERTURE_VALUE),
42
+ arrayOf("double", ExifInterface.TAG_BRIGHTNESS_VALUE),
43
+ arrayOf("string", ExifInterface.TAG_CFA_PATTERN),
44
+ arrayOf("int", ExifInterface.TAG_COLOR_SPACE),
45
+ arrayOf("array", ExifInterface.TAG_COMPONENTS_CONFIGURATION),
46
+ arrayOf("double", ExifInterface.TAG_COMPRESSED_BITS_PER_PIXEL),
47
+ arrayOf("int", ExifInterface.TAG_CONTRAST),
48
+ arrayOf("int", ExifInterface.TAG_CUSTOM_RENDERED),
49
+ arrayOf("string", ExifInterface.TAG_DATETIME_DIGITIZED),
50
+ arrayOf("string", ExifInterface.TAG_DATETIME_ORIGINAL),
51
+ arrayOf("string", ExifInterface.TAG_DEVICE_SETTING_DESCRIPTION),
52
+ arrayOf("double", ExifInterface.TAG_DIGITAL_ZOOM_RATIO),
53
+ arrayOf("array", ExifInterface.TAG_EXIF_VERSION),
54
+ arrayOf("double", ExifInterface.TAG_EXPOSURE_BIAS_VALUE),
55
+ arrayOf("double", ExifInterface.TAG_EXPOSURE_INDEX),
56
+ arrayOf("int", ExifInterface.TAG_EXPOSURE_MODE),
57
+ arrayOf("int", ExifInterface.TAG_EXPOSURE_PROGRAM),
58
+ arrayOf("double", ExifInterface.TAG_EXPOSURE_TIME),
59
+ arrayOf("double", ExifInterface.TAG_F_NUMBER),
60
+ arrayOf("string", ExifInterface.TAG_FILE_SOURCE),
61
+ arrayOf("int", ExifInterface.TAG_FLASH),
62
+ arrayOf("double", ExifInterface.TAG_FLASH_ENERGY),
63
+ arrayOf("array", ExifInterface.TAG_FLASHPIX_VERSION),
64
+ arrayOf("double", ExifInterface.TAG_FOCAL_LENGTH),
65
+ arrayOf("string", ExifInterface.TAG_LENS_MAKE),
66
+ arrayOf("string", ExifInterface.TAG_LENS_MODEL),
67
+ arrayOf("array", ExifInterface.TAG_LENS_SPECIFICATION),
68
+ arrayOf("int", ExifInterface.TAG_FOCAL_LENGTH_IN_35MM_FILM),
69
+ arrayOf("int", ExifInterface.TAG_FOCAL_PLANE_RESOLUTION_UNIT),
70
+ arrayOf("double", ExifInterface.TAG_FOCAL_PLANE_X_RESOLUTION),
71
+ arrayOf("double", ExifInterface.TAG_FOCAL_PLANE_Y_RESOLUTION),
72
+ arrayOf("int", ExifInterface.TAG_GAIN_CONTROL),
73
+ arrayOf("string", ExifInterface.TAG_ISO_SPEED_RATINGS),
74
+ arrayOf("string", ExifInterface.TAG_IMAGE_UNIQUE_ID),
75
+ arrayOf("int", ExifInterface.TAG_LIGHT_SOURCE),
76
+ arrayOf("string", ExifInterface.TAG_MAKER_NOTE),
77
+ arrayOf("double", ExifInterface.TAG_MAX_APERTURE_VALUE),
78
+ arrayOf("int", ExifInterface.TAG_METERING_MODE),
79
+ arrayOf("int", ExifInterface.TAG_NEW_SUBFILE_TYPE),
80
+ arrayOf("string", ExifInterface.TAG_OECF),
81
+ arrayOf("int", ExifInterface.TAG_PIXEL_X_DIMENSION),
82
+ arrayOf("int", ExifInterface.TAG_PIXEL_Y_DIMENSION),
83
+ arrayOf("string", ExifInterface.TAG_RELATED_SOUND_FILE),
84
+ arrayOf("int", ExifInterface.TAG_SATURATION),
85
+ arrayOf("int", ExifInterface.TAG_SCENE_CAPTURE_TYPE),
86
+ arrayOf("string", ExifInterface.TAG_SCENE_TYPE),
87
+ arrayOf("int", ExifInterface.TAG_SENSING_METHOD),
88
+ arrayOf("int", ExifInterface.TAG_SHARPNESS),
89
+ arrayOf("double", ExifInterface.TAG_SHUTTER_SPEED_VALUE),
90
+ arrayOf("string", ExifInterface.TAG_SPATIAL_FREQUENCY_RESPONSE),
91
+ arrayOf("string", ExifInterface.TAG_SPECTRAL_SENSITIVITY),
92
+ arrayOf("int", ExifInterface.TAG_SUBFILE_TYPE),
93
+ arrayOf("string", ExifInterface.TAG_SUBSEC_TIME),
94
+ arrayOf("string", ExifInterface.TAG_SUBSEC_TIME_DIGITIZED),
95
+ arrayOf("string", ExifInterface.TAG_SUBSEC_TIME_ORIGINAL),
96
+ arrayOf("array", ExifInterface.TAG_SUBJECT_AREA),
97
+ arrayOf("double", ExifInterface.TAG_SUBJECT_DISTANCE),
98
+ arrayOf("int", ExifInterface.TAG_SUBJECT_DISTANCE_RANGE),
99
+ arrayOf("int", ExifInterface.TAG_SUBJECT_LOCATION),
100
+ arrayOf("string", ExifInterface.TAG_USER_COMMENT),
101
+ arrayOf("int", ExifInterface.TAG_WHITE_BALANCE),
102
+ arrayOf("int", ExifInterface.TAG_GPS_ALTITUDE_REF),
103
+ arrayOf("string", ExifInterface.TAG_GPS_AREA_INFORMATION),
104
+ arrayOf("double", ExifInterface.TAG_GPS_DOP),
105
+ arrayOf("string", ExifInterface.TAG_GPS_DATESTAMP),
106
+ arrayOf("double", ExifInterface.TAG_GPS_DEST_BEARING),
107
+ arrayOf("string", ExifInterface.TAG_GPS_DEST_BEARING_REF),
108
+ arrayOf("double", ExifInterface.TAG_GPS_DEST_DISTANCE),
109
+ arrayOf("string", ExifInterface.TAG_GPS_DEST_DISTANCE_REF),
110
+ arrayOf("double", ExifInterface.TAG_GPS_DEST_LATITUDE),
111
+ arrayOf("string", ExifInterface.TAG_GPS_DEST_LATITUDE_REF),
112
+ arrayOf("double", ExifInterface.TAG_GPS_DEST_LONGITUDE),
113
+ arrayOf("string", ExifInterface.TAG_GPS_DEST_LONGITUDE_REF),
114
+ arrayOf("int", ExifInterface.TAG_GPS_DIFFERENTIAL),
115
+ arrayOf("string", ExifInterface.TAG_GPS_H_POSITIONING_ERROR),
116
+ arrayOf("double", ExifInterface.TAG_GPS_IMG_DIRECTION),
117
+ arrayOf("string", ExifInterface.TAG_GPS_IMG_DIRECTION_REF),
118
+ arrayOf("string", ExifInterface.TAG_GPS_LATITUDE_REF),
119
+ arrayOf("string", ExifInterface.TAG_GPS_LONGITUDE_REF),
120
+ arrayOf("string", ExifInterface.TAG_GPS_MAP_DATUM),
121
+ arrayOf("string", ExifInterface.TAG_GPS_MEASURE_MODE),
122
+ arrayOf("string", ExifInterface.TAG_GPS_PROCESSING_METHOD),
123
+ arrayOf("string", ExifInterface.TAG_GPS_SATELLITES),
124
+ arrayOf("double", ExifInterface.TAG_GPS_SPEED),
125
+ arrayOf("string", ExifInterface.TAG_GPS_SPEED_REF),
126
+ arrayOf("string", ExifInterface.TAG_GPS_STATUS),
127
+ arrayOf("string", ExifInterface.TAG_GPS_TIMESTAMP),
128
+ arrayOf("double", ExifInterface.TAG_GPS_TRACK),
129
+ arrayOf("string", ExifInterface.TAG_GPS_TRACK_REF),
130
+ arrayOf("string", ExifInterface.TAG_GPS_VERSION_ID),
131
+ arrayOf("string", ExifInterface.TAG_INTEROPERABILITY_INDEX),
132
+ arrayOf("int", ExifInterface.TAG_THUMBNAIL_IMAGE_LENGTH),
133
+ arrayOf("int", ExifInterface.TAG_THUMBNAIL_IMAGE_WIDTH),
134
+ arrayOf("int", ExifInterface.TAG_DNG_VERSION),
135
+ arrayOf("int", ExifInterface.TAG_DEFAULT_CROP_SIZE),
136
+ arrayOf("int", ExifInterface.TAG_ORF_PREVIEW_IMAGE_START),
137
+ arrayOf("int", ExifInterface.TAG_ORF_PREVIEW_IMAGE_LENGTH),
138
+ arrayOf("int", ExifInterface.TAG_ORF_ASPECT_FRAME),
139
+ arrayOf("int", ExifInterface.TAG_RW2_SENSOR_BOTTOM_BORDER),
140
+ arrayOf("int", ExifInterface.TAG_RW2_SENSOR_LEFT_BORDER),
141
+ arrayOf("int", ExifInterface.TAG_RW2_SENSOR_RIGHT_BORDER),
142
+ arrayOf("int", ExifInterface.TAG_RW2_SENSOR_TOP_BORDER),
143
+ arrayOf("int", ExifInterface.TAG_RW2_ISO),
144
+ )
@@ -3,7 +3,6 @@ package com.lodev09.exify
3
3
  import androidx.exifinterface.media.ExifInterface
4
4
  import com.facebook.react.bridge.Arguments
5
5
  import com.facebook.react.bridge.ReadableMap
6
- import java.io.InputStream
7
6
 
8
7
  object ExifyUtils {
9
8
  @JvmStatic
@@ -14,9 +13,18 @@ object ExifyUtils {
14
13
  val attribute = exif.getAttribute(tag)
15
14
  if (attribute != null && attribute != "") {
16
15
  when (type) {
17
- "string" -> tags.putString(tag, attribute)
18
- "int" -> tags.putInt(tag, exif.getAttributeInt(tag, 0))
19
- "double" -> tags.putDouble(tag, exif.getAttributeDouble(tag, 0.0))
16
+ "string" -> {
17
+ tags.putString(tag, attribute)
18
+ }
19
+
20
+ "int" -> {
21
+ tags.putInt(tag, exif.getAttributeInt(tag, 0))
22
+ }
23
+
24
+ "double" -> {
25
+ tags.putDouble(tag, exif.getAttributeDouble(tag, 0.0))
26
+ }
27
+
20
28
  "array" -> {
21
29
  val array = Arguments.createArray()
22
30
  exif.getAttributeRange(tag)?.forEach { value ->
@@ -29,13 +37,28 @@ object ExifyUtils {
29
37
  }
30
38
  }
31
39
 
32
- // GPS
40
+ // GPS — return absolute values (sign is in LatitudeRef/LongitudeRef)
33
41
  exif.latLong?.let {
34
- tags.putDouble(ExifInterface.TAG_GPS_ALTITUDE, exif.getAltitude(0.0))
35
- tags.putDouble(ExifInterface.TAG_GPS_LATITUDE, it[0])
36
- tags.putDouble(ExifInterface.TAG_GPS_LONGITUDE, it[1])
42
+ tags.putDouble(ExifInterface.TAG_GPS_ALTITUDE, Math.abs(exif.getAltitude(0.0)))
43
+ tags.putDouble(ExifInterface.TAG_GPS_LATITUDE, Math.abs(it[0]))
44
+ tags.putDouble(ExifInterface.TAG_GPS_LONGITUDE, Math.abs(it[1]))
37
45
  }
38
46
 
39
47
  return tags
40
48
  }
49
+
50
+ @JvmStatic
51
+ fun decimalToDms(decimal: Double): String {
52
+ val degrees = decimal.toInt()
53
+ val minutesDecimal = (decimal - degrees) * 60
54
+ val minutes = minutesDecimal.toInt()
55
+ val seconds = ((minutesDecimal - minutes) * 60 * 10000).toLong()
56
+ return "$degrees/1,$minutes/1,$seconds/10000"
57
+ }
58
+
59
+ @JvmStatic
60
+ fun decimalToRational(value: Double): String {
61
+ val numerator = (value * 10000).toLong()
62
+ return "$numerator/10000"
63
+ }
41
64
  }
package/ios/Exify.h ADDED
@@ -0,0 +1,9 @@
1
+ #import <ExifySpec/ExifySpec.h>
2
+ #import <ImageIO/ImageIO.h>
3
+ #import <Photos/Photos.h>
4
+ #import <React/RCTLog.h>
5
+ #import <UIKit/UIKit.h>
6
+
7
+ @interface Exify : NSObject <NativeExifyModuleSpec>
8
+
9
+ @end