We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dcc5a97 commit a7e3e14Copy full SHA for a7e3e14
5 files changed
android/src/main/java/com/lodev09/exify/ExifyModule.kt
@@ -182,7 +182,9 @@ class ExifyModule(
182
}
183
184
ReadableType.Array -> {
185
- exif.setAttribute(tag, tags.getArray(tag).toString())
+ val arr = tags.getArray(tag)!!
186
+ val values = (0 until arr.size()).joinToString(", ") { arr.getInt(it).toString() }
187
+ exif.setAttribute(tag, values)
188
189
190
else -> {
android/src/main/java/com/lodev09/exify/ExifyTags.kt
@@ -78,13 +78,14 @@ val EXIFY_TAGS =
78
arrayOf("double", ExifInterface.TAG_FOCAL_LENGTH),
79
arrayOf("string", ExifInterface.TAG_LENS_MAKE),
80
arrayOf("string", ExifInterface.TAG_LENS_MODEL),
81
+ arrayOf("string", ExifInterface.TAG_BODY_SERIAL_NUMBER),
82
arrayOf("array", ExifInterface.TAG_LENS_SPECIFICATION),
83
arrayOf("int", ExifInterface.TAG_FOCAL_LENGTH_IN_35MM_FILM),
84
arrayOf("int", ExifInterface.TAG_FOCAL_PLANE_RESOLUTION_UNIT),
85
arrayOf("double", ExifInterface.TAG_FOCAL_PLANE_X_RESOLUTION),
86
arrayOf("double", ExifInterface.TAG_FOCAL_PLANE_Y_RESOLUTION),
87
arrayOf("int", ExifInterface.TAG_GAIN_CONTROL),
- arrayOf("string", ExifInterface.TAG_ISO_SPEED_RATINGS),
88
+ arrayOf("int_array", ExifInterface.TAG_ISO_SPEED_RATINGS),
89
arrayOf("string", ExifInterface.TAG_IMAGE_UNIQUE_ID),
90
arrayOf("int", ExifInterface.TAG_LIGHT_SOURCE),
91
arrayOf("string", ExifInterface.TAG_MAKER_NOTE),
android/src/main/java/com/lodev09/exify/ExifyUtils.kt
@@ -18,13 +18,23 @@ object ExifyUtils {
18
19
20
"int" -> {
21
- tags.putInt(tag, exif.getAttributeInt(tag, 0))
+ val intVal = exif.getAttributeInt(tag, 0)
22
+ if (tag == ExifInterface.TAG_ORIENTATION && intVal == 0) continue
23
+ tags.putInt(tag, intVal)
24
25
26
"double" -> {
27
tags.putDouble(tag, exif.getAttributeDouble(tag, 0.0))
28
29
30
+ "int_array" -> {
31
+ val array = Arguments.createArray()
32
+ attribute.split(", ").forEach { part ->
33
+ part.trim().toIntOrNull()?.let { array.pushInt(it) }
34
+ }
35
+ if (array.size() > 0) tags.putArray(tag, array)
36
37
+
38
"array" -> {
39
val array = Arguments.createArray()
40
exif.getAttributeRange(tag)?.forEach { value ->
ios/Exify.mm
@@ -42,7 +42,13 @@ static void addTagEntries(CFStringRef dictionary, NSDictionary *metadata,
42
id value = metadata[key];
43
if (![value isKindOfClass:[NSDictionary class]] &&
44
![key isEqualToString:compressionKey]) {
45
- tags[key] = value;
+ NSString *mappedKey = key;
46
+ if ([key isEqualToString:@"PixelWidth"]) {
47
+ mappedKey = @"PixelXDimension";
48
+ } else if ([key isEqualToString:@"PixelHeight"]) {
49
+ mappedKey = @"PixelYDimension";
50
51
+ tags[mappedKey] = value;
52
53
54
src/types.ts
@@ -63,13 +63,14 @@ export interface ExifTags {
63
LightSource?: number;
64
UserComment?: string;
65
GainControl?: number;
66
- ISOSpeedRatings?: string;
+ ISOSpeedRatings?: number[];
67
FocalPlaneResolutionUnit?: number;
68
FocalPlaneXResolution?: number;
69
YCbCrCoefficients?: number;
70
FocalLengthIn35mmFilm?: number;
71
LensMake?: string;
72
LensModel?: string;
73
+ BodySerialNumber?: string;
74
LensSpecification?: number[];
75
ISO?: number;
76
FlashpixVersion?: number[];
0 commit comments