@capawesome/capacitor-exif 0.0.1

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 (43) hide show
  1. package/CapawesomeCapacitorExif.podspec +17 -0
  2. package/LICENSE +21 -0
  3. package/Package.swift +28 -0
  4. package/README.md +322 -0
  5. package/android/build.gradle +60 -0
  6. package/android/src/main/AndroidManifest.xml +2 -0
  7. package/android/src/main/java/io/capawesome/capacitorjs/plugins/exif/Exif.java +289 -0
  8. package/android/src/main/java/io/capawesome/capacitorjs/plugins/exif/ExifPlugin.java +120 -0
  9. package/android/src/main/java/io/capawesome/capacitorjs/plugins/exif/classes/CustomException.java +20 -0
  10. package/android/src/main/java/io/capawesome/capacitorjs/plugins/exif/classes/CustomExceptions.java +27 -0
  11. package/android/src/main/java/io/capawesome/capacitorjs/plugins/exif/classes/options/ReadExifOptions.java +36 -0
  12. package/android/src/main/java/io/capawesome/capacitorjs/plugins/exif/classes/options/RemoveExifOptions.java +43 -0
  13. package/android/src/main/java/io/capawesome/capacitorjs/plugins/exif/classes/options/WriteExifOptions.java +185 -0
  14. package/android/src/main/java/io/capawesome/capacitorjs/plugins/exif/classes/results/ReadExifResult.java +152 -0
  15. package/android/src/main/java/io/capawesome/capacitorjs/plugins/exif/interfaces/Callback.java +5 -0
  16. package/android/src/main/java/io/capawesome/capacitorjs/plugins/exif/interfaces/EmptyCallback.java +5 -0
  17. package/android/src/main/java/io/capawesome/capacitorjs/plugins/exif/interfaces/NonEmptyResultCallback.java +7 -0
  18. package/android/src/main/java/io/capawesome/capacitorjs/plugins/exif/interfaces/Result.java +7 -0
  19. package/android/src/main/res/.gitkeep +0 -0
  20. package/dist/docs.json +746 -0
  21. package/dist/esm/definitions.d.ts +375 -0
  22. package/dist/esm/definitions.js +32 -0
  23. package/dist/esm/definitions.js.map +1 -0
  24. package/dist/esm/index.d.ts +4 -0
  25. package/dist/esm/index.js +7 -0
  26. package/dist/esm/index.js.map +1 -0
  27. package/dist/esm/web.d.ts +7 -0
  28. package/dist/esm/web.js +13 -0
  29. package/dist/esm/web.js.map +1 -0
  30. package/dist/plugin.cjs.js +59 -0
  31. package/dist/plugin.cjs.js.map +1 -0
  32. package/dist/plugin.js +62 -0
  33. package/dist/plugin.js.map +1 -0
  34. package/ios/Plugin/Classes/Options/ReadExifOptions.swift +20 -0
  35. package/ios/Plugin/Classes/Options/RemoveExifOptions.swift +12 -0
  36. package/ios/Plugin/Classes/Options/WriteExifOptions.swift +49 -0
  37. package/ios/Plugin/Classes/Results/ReadExifResult.swift +75 -0
  38. package/ios/Plugin/Enums/CustomError.swift +54 -0
  39. package/ios/Plugin/Exif.swift +219 -0
  40. package/ios/Plugin/ExifPlugin.swift +83 -0
  41. package/ios/Plugin/Info.plist +24 -0
  42. package/ios/Plugin/Protocols/Result.swift +5 -0
  43. package/package.json +97 -0
@@ -0,0 +1,375 @@
1
+ export interface ExifPlugin {
2
+ /**
3
+ * Read the EXIF metadata of an image file.
4
+ *
5
+ * Only available on Android and iOS.
6
+ *
7
+ * @since 0.1.0
8
+ */
9
+ readExif(options: ReadExifOptions): Promise<ReadExifResult>;
10
+ /**
11
+ * Remove the EXIF metadata from an image file in place.
12
+ *
13
+ * The pixel data is never re-encoded, so the image quality
14
+ * is not affected.
15
+ *
16
+ * Only available on Android and iOS.
17
+ *
18
+ * @since 0.1.0
19
+ */
20
+ removeExif(options: RemoveExifOptions): Promise<void>;
21
+ /**
22
+ * Write EXIF metadata to an image file in place.
23
+ *
24
+ * Only the provided tags are updated. All other tags remain unchanged.
25
+ * The pixel data is never re-encoded, so the image quality
26
+ * is not affected.
27
+ *
28
+ * Only available on Android and iOS.
29
+ *
30
+ * @since 0.1.0
31
+ */
32
+ writeExif(options: WriteExifOptions): Promise<void>;
33
+ }
34
+ /**
35
+ * The EXIF tags of an image file.
36
+ *
37
+ * Every property is optional and only present if the tag
38
+ * exists in the file.
39
+ *
40
+ * @since 0.1.0
41
+ */
42
+ export interface ExifTags {
43
+ /**
44
+ * The date and time when the image was originally captured
45
+ * in the EXIF date format `YYYY:MM:DD HH:MM:SS`.
46
+ *
47
+ * @since 0.1.0
48
+ * @example '2026:01:15 10:30:00'
49
+ */
50
+ dateTimeOriginal?: string;
51
+ /**
52
+ * The exposure time in seconds.
53
+ *
54
+ * @since 0.1.0
55
+ * @example 0.008
56
+ */
57
+ exposureTime?: number;
58
+ /**
59
+ * The F number (aperture) of the lens.
60
+ *
61
+ * @since 0.1.0
62
+ * @example 1.8
63
+ */
64
+ fNumber?: number;
65
+ /**
66
+ * Whether or not the flash fired when the image was captured.
67
+ *
68
+ * @since 0.1.0
69
+ * @example true
70
+ */
71
+ flash?: boolean;
72
+ /**
73
+ * The focal length of the lens in millimeters.
74
+ *
75
+ * @since 0.1.0
76
+ * @example 26
77
+ */
78
+ focalLength?: number;
79
+ /**
80
+ * The altitude in meters above (positive) or below (negative) sea level.
81
+ *
82
+ * @since 0.1.0
83
+ * @example 11.5
84
+ */
85
+ gpsAltitude?: number;
86
+ /**
87
+ * The latitude in signed decimal degrees.
88
+ *
89
+ * Positive values are north of the equator, negative values are south.
90
+ *
91
+ * @since 0.1.0
92
+ * @example 51.503364
93
+ */
94
+ gpsLatitude?: number;
95
+ /**
96
+ * The longitude in signed decimal degrees.
97
+ *
98
+ * Positive values are east of the prime meridian, negative values are west.
99
+ *
100
+ * @since 0.1.0
101
+ * @example -0.127625
102
+ */
103
+ gpsLongitude?: number;
104
+ /**
105
+ * The ISO speed rating (photographic sensitivity).
106
+ *
107
+ * @since 0.1.0
108
+ * @example 125
109
+ */
110
+ iso?: number;
111
+ /**
112
+ * The model of the lens.
113
+ *
114
+ * @since 0.1.0
115
+ * @example 'iPhone 15 Pro back triple camera 6.765mm f/1.78'
116
+ */
117
+ lensModel?: string;
118
+ /**
119
+ * The manufacturer of the camera.
120
+ *
121
+ * @since 0.1.0
122
+ * @example 'Apple'
123
+ */
124
+ make?: string;
125
+ /**
126
+ * The model of the camera.
127
+ *
128
+ * @since 0.1.0
129
+ * @example 'iPhone 15 Pro'
130
+ */
131
+ model?: string;
132
+ /**
133
+ * The orientation of the image as defined by the EXIF specification (1-8).
134
+ *
135
+ * @since 0.1.0
136
+ * @example 6
137
+ */
138
+ orientation?: number;
139
+ /**
140
+ * The height of the image in pixels.
141
+ *
142
+ * @since 0.1.0
143
+ * @example 480
144
+ */
145
+ pixelHeight?: number;
146
+ /**
147
+ * The width of the image in pixels.
148
+ *
149
+ * @since 0.1.0
150
+ * @example 640
151
+ */
152
+ pixelWidth?: number;
153
+ /**
154
+ * The name of the software that was used to create or edit the image.
155
+ *
156
+ * @since 0.1.0
157
+ * @example 'Adobe Photoshop'
158
+ */
159
+ software?: string;
160
+ }
161
+ /**
162
+ * @since 0.1.0
163
+ */
164
+ export interface ReadExifOptions {
165
+ /**
166
+ * The path to the image file to read the EXIF metadata from.
167
+ *
168
+ * Local file paths and `file://` URIs are supported.
169
+ *
170
+ * @since 0.1.0
171
+ * @example '/data/user/0/dev.robingenz.capacitor.plugindemo/cache/photo.jpg'
172
+ */
173
+ path: string;
174
+ }
175
+ /**
176
+ * @since 0.1.0
177
+ */
178
+ export interface ReadExifResult {
179
+ /**
180
+ * The EXIF tags that were read from the image file.
181
+ *
182
+ * @since 0.1.0
183
+ */
184
+ tags: ExifTags;
185
+ }
186
+ /**
187
+ * @since 0.1.0
188
+ */
189
+ export interface RemoveExifOptions {
190
+ /**
191
+ * Whether or not to keep the orientation tag when removing
192
+ * the EXIF metadata.
193
+ *
194
+ * This is enabled by default so that images are not suddenly
195
+ * displayed rotated after the metadata has been removed.
196
+ *
197
+ * @since 0.1.0
198
+ * @default true
199
+ * @example false
200
+ */
201
+ keepOrientation?: boolean;
202
+ /**
203
+ * The path to the image file to remove the EXIF metadata from.
204
+ *
205
+ * Local file paths and `file://` URIs are supported.
206
+ *
207
+ * @since 0.1.0
208
+ * @example '/data/user/0/dev.robingenz.capacitor.plugindemo/cache/photo.jpg'
209
+ */
210
+ path: string;
211
+ }
212
+ /**
213
+ * The writable subset of the EXIF tags.
214
+ *
215
+ * @since 0.1.0
216
+ */
217
+ export interface WritableExifTags {
218
+ /**
219
+ * The date and time when the image was originally captured
220
+ * in the EXIF date format `YYYY:MM:DD HH:MM:SS`.
221
+ *
222
+ * @since 0.1.0
223
+ * @example '2026:01:15 10:30:00'
224
+ */
225
+ dateTimeOriginal?: string;
226
+ /**
227
+ * The exposure time in seconds.
228
+ *
229
+ * @since 0.1.0
230
+ * @example 0.008
231
+ */
232
+ exposureTime?: number;
233
+ /**
234
+ * The F number (aperture) of the lens.
235
+ *
236
+ * @since 0.1.0
237
+ * @example 1.8
238
+ */
239
+ fNumber?: number;
240
+ /**
241
+ * Whether or not the flash fired when the image was captured.
242
+ *
243
+ * @since 0.1.0
244
+ * @example true
245
+ */
246
+ flash?: boolean;
247
+ /**
248
+ * The focal length of the lens in millimeters.
249
+ *
250
+ * @since 0.1.0
251
+ * @example 26
252
+ */
253
+ focalLength?: number;
254
+ /**
255
+ * The altitude in meters above (positive) or below (negative) sea level.
256
+ *
257
+ * @since 0.1.0
258
+ * @example 11.5
259
+ */
260
+ gpsAltitude?: number;
261
+ /**
262
+ * The latitude in signed decimal degrees.
263
+ *
264
+ * Positive values are north of the equator, negative values are south.
265
+ * Must be provided together with `gpsLongitude`.
266
+ *
267
+ * @since 0.1.0
268
+ * @example 51.503364
269
+ */
270
+ gpsLatitude?: number;
271
+ /**
272
+ * The longitude in signed decimal degrees.
273
+ *
274
+ * Positive values are east of the prime meridian, negative values are west.
275
+ * Must be provided together with `gpsLatitude`.
276
+ *
277
+ * @since 0.1.0
278
+ * @example -0.127625
279
+ */
280
+ gpsLongitude?: number;
281
+ /**
282
+ * The ISO speed rating (photographic sensitivity).
283
+ *
284
+ * @since 0.1.0
285
+ * @example 125
286
+ */
287
+ iso?: number;
288
+ /**
289
+ * The model of the lens.
290
+ *
291
+ * @since 0.1.0
292
+ * @example 'iPhone 15 Pro back triple camera 6.765mm f/1.78'
293
+ */
294
+ lensModel?: string;
295
+ /**
296
+ * The manufacturer of the camera.
297
+ *
298
+ * @since 0.1.0
299
+ * @example 'Apple'
300
+ */
301
+ make?: string;
302
+ /**
303
+ * The model of the camera.
304
+ *
305
+ * @since 0.1.0
306
+ * @example 'iPhone 15 Pro'
307
+ */
308
+ model?: string;
309
+ /**
310
+ * The orientation of the image as defined by the EXIF specification (1-8).
311
+ *
312
+ * @since 0.1.0
313
+ * @example 6
314
+ */
315
+ orientation?: number;
316
+ /**
317
+ * The name of the software that was used to create or edit the image.
318
+ *
319
+ * @since 0.1.0
320
+ * @example 'Adobe Photoshop'
321
+ */
322
+ software?: string;
323
+ }
324
+ /**
325
+ * @since 0.1.0
326
+ */
327
+ export interface WriteExifOptions {
328
+ /**
329
+ * The path to the image file to write the EXIF metadata to.
330
+ *
331
+ * Local file paths and `file://` URIs are supported.
332
+ *
333
+ * @since 0.1.0
334
+ * @example '/data/user/0/dev.robingenz.capacitor.plugindemo/cache/photo.jpg'
335
+ */
336
+ path: string;
337
+ /**
338
+ * The EXIF tags to write to the image file.
339
+ *
340
+ * Only the provided tags are updated. All other tags remain unchanged.
341
+ *
342
+ * @since 0.1.0
343
+ */
344
+ tags: WritableExifTags;
345
+ }
346
+ /**
347
+ * @since 0.1.0
348
+ */
349
+ export declare enum ErrorCode {
350
+ /**
351
+ * The file was not found at the provided path.
352
+ *
353
+ * @since 0.1.0
354
+ */
355
+ FileNotFound = "FILE_NOT_FOUND",
356
+ /**
357
+ * The EXIF metadata could not be read from the file.
358
+ *
359
+ * @since 0.1.0
360
+ */
361
+ ReadFailed = "READ_FAILED",
362
+ /**
363
+ * The file format does not support writing or removing EXIF metadata
364
+ * on this platform.
365
+ *
366
+ * @since 0.1.0
367
+ */
368
+ UnsupportedFormat = "UNSUPPORTED_FORMAT",
369
+ /**
370
+ * The EXIF metadata could not be written to the file.
371
+ *
372
+ * @since 0.1.0
373
+ */
374
+ WriteFailed = "WRITE_FAILED"
375
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @since 0.1.0
3
+ */
4
+ export var ErrorCode;
5
+ (function (ErrorCode) {
6
+ /**
7
+ * The file was not found at the provided path.
8
+ *
9
+ * @since 0.1.0
10
+ */
11
+ ErrorCode["FileNotFound"] = "FILE_NOT_FOUND";
12
+ /**
13
+ * The EXIF metadata could not be read from the file.
14
+ *
15
+ * @since 0.1.0
16
+ */
17
+ ErrorCode["ReadFailed"] = "READ_FAILED";
18
+ /**
19
+ * The file format does not support writing or removing EXIF metadata
20
+ * on this platform.
21
+ *
22
+ * @since 0.1.0
23
+ */
24
+ ErrorCode["UnsupportedFormat"] = "UNSUPPORTED_FORMAT";
25
+ /**
26
+ * The EXIF metadata could not be written to the file.
27
+ *
28
+ * @since 0.1.0
29
+ */
30
+ ErrorCode["WriteFailed"] = "WRITE_FAILED";
31
+ })(ErrorCode || (ErrorCode = {}));
32
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAgWA;;GAEG;AACH,MAAM,CAAN,IAAY,SA0BX;AA1BD,WAAY,SAAS;IACnB;;;;OAIG;IACH,4CAA+B,CAAA;IAC/B;;;;OAIG;IACH,uCAA0B,CAAA;IAC1B;;;;;OAKG;IACH,qDAAwC,CAAA;IACxC;;;;OAIG;IACH,yCAA4B,CAAA;AAC9B,CAAC,EA1BW,SAAS,KAAT,SAAS,QA0BpB","sourcesContent":["export interface ExifPlugin {\n /**\n * Read the EXIF metadata of an image file.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n readExif(options: ReadExifOptions): Promise<ReadExifResult>;\n /**\n * Remove the EXIF metadata from an image file in place.\n *\n * The pixel data is never re-encoded, so the image quality\n * is not affected.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n removeExif(options: RemoveExifOptions): Promise<void>;\n /**\n * Write EXIF metadata to an image file in place.\n *\n * Only the provided tags are updated. All other tags remain unchanged.\n * The pixel data is never re-encoded, so the image quality\n * is not affected.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n writeExif(options: WriteExifOptions): Promise<void>;\n}\n\n/**\n * The EXIF tags of an image file.\n *\n * Every property is optional and only present if the tag\n * exists in the file.\n *\n * @since 0.1.0\n */\nexport interface ExifTags {\n /**\n * The date and time when the image was originally captured\n * in the EXIF date format `YYYY:MM:DD HH:MM:SS`.\n *\n * @since 0.1.0\n * @example '2026:01:15 10:30:00'\n */\n dateTimeOriginal?: string;\n /**\n * The exposure time in seconds.\n *\n * @since 0.1.0\n * @example 0.008\n */\n exposureTime?: number;\n /**\n * The F number (aperture) of the lens.\n *\n * @since 0.1.0\n * @example 1.8\n */\n fNumber?: number;\n /**\n * Whether or not the flash fired when the image was captured.\n *\n * @since 0.1.0\n * @example true\n */\n flash?: boolean;\n /**\n * The focal length of the lens in millimeters.\n *\n * @since 0.1.0\n * @example 26\n */\n focalLength?: number;\n /**\n * The altitude in meters above (positive) or below (negative) sea level.\n *\n * @since 0.1.0\n * @example 11.5\n */\n gpsAltitude?: number;\n /**\n * The latitude in signed decimal degrees.\n *\n * Positive values are north of the equator, negative values are south.\n *\n * @since 0.1.0\n * @example 51.503364\n */\n gpsLatitude?: number;\n /**\n * The longitude in signed decimal degrees.\n *\n * Positive values are east of the prime meridian, negative values are west.\n *\n * @since 0.1.0\n * @example -0.127625\n */\n gpsLongitude?: number;\n /**\n * The ISO speed rating (photographic sensitivity).\n *\n * @since 0.1.0\n * @example 125\n */\n iso?: number;\n /**\n * The model of the lens.\n *\n * @since 0.1.0\n * @example 'iPhone 15 Pro back triple camera 6.765mm f/1.78'\n */\n lensModel?: string;\n /**\n * The manufacturer of the camera.\n *\n * @since 0.1.0\n * @example 'Apple'\n */\n make?: string;\n /**\n * The model of the camera.\n *\n * @since 0.1.0\n * @example 'iPhone 15 Pro'\n */\n model?: string;\n /**\n * The orientation of the image as defined by the EXIF specification (1-8).\n *\n * @since 0.1.0\n * @example 6\n */\n orientation?: number;\n /**\n * The height of the image in pixels.\n *\n * @since 0.1.0\n * @example 480\n */\n pixelHeight?: number;\n /**\n * The width of the image in pixels.\n *\n * @since 0.1.0\n * @example 640\n */\n pixelWidth?: number;\n /**\n * The name of the software that was used to create or edit the image.\n *\n * @since 0.1.0\n * @example 'Adobe Photoshop'\n */\n software?: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface ReadExifOptions {\n /**\n * The path to the image file to read the EXIF metadata from.\n *\n * Local file paths and `file://` URIs are supported.\n *\n * @since 0.1.0\n * @example '/data/user/0/dev.robingenz.capacitor.plugindemo/cache/photo.jpg'\n */\n path: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface ReadExifResult {\n /**\n * The EXIF tags that were read from the image file.\n *\n * @since 0.1.0\n */\n tags: ExifTags;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface RemoveExifOptions {\n /**\n * Whether or not to keep the orientation tag when removing\n * the EXIF metadata.\n *\n * This is enabled by default so that images are not suddenly\n * displayed rotated after the metadata has been removed.\n *\n * @since 0.1.0\n * @default true\n * @example false\n */\n keepOrientation?: boolean;\n /**\n * The path to the image file to remove the EXIF metadata from.\n *\n * Local file paths and `file://` URIs are supported.\n *\n * @since 0.1.0\n * @example '/data/user/0/dev.robingenz.capacitor.plugindemo/cache/photo.jpg'\n */\n path: string;\n}\n\n/**\n * The writable subset of the EXIF tags.\n *\n * @since 0.1.0\n */\nexport interface WritableExifTags {\n /**\n * The date and time when the image was originally captured\n * in the EXIF date format `YYYY:MM:DD HH:MM:SS`.\n *\n * @since 0.1.0\n * @example '2026:01:15 10:30:00'\n */\n dateTimeOriginal?: string;\n /**\n * The exposure time in seconds.\n *\n * @since 0.1.0\n * @example 0.008\n */\n exposureTime?: number;\n /**\n * The F number (aperture) of the lens.\n *\n * @since 0.1.0\n * @example 1.8\n */\n fNumber?: number;\n /**\n * Whether or not the flash fired when the image was captured.\n *\n * @since 0.1.0\n * @example true\n */\n flash?: boolean;\n /**\n * The focal length of the lens in millimeters.\n *\n * @since 0.1.0\n * @example 26\n */\n focalLength?: number;\n /**\n * The altitude in meters above (positive) or below (negative) sea level.\n *\n * @since 0.1.0\n * @example 11.5\n */\n gpsAltitude?: number;\n /**\n * The latitude in signed decimal degrees.\n *\n * Positive values are north of the equator, negative values are south.\n * Must be provided together with `gpsLongitude`.\n *\n * @since 0.1.0\n * @example 51.503364\n */\n gpsLatitude?: number;\n /**\n * The longitude in signed decimal degrees.\n *\n * Positive values are east of the prime meridian, negative values are west.\n * Must be provided together with `gpsLatitude`.\n *\n * @since 0.1.0\n * @example -0.127625\n */\n gpsLongitude?: number;\n /**\n * The ISO speed rating (photographic sensitivity).\n *\n * @since 0.1.0\n * @example 125\n */\n iso?: number;\n /**\n * The model of the lens.\n *\n * @since 0.1.0\n * @example 'iPhone 15 Pro back triple camera 6.765mm f/1.78'\n */\n lensModel?: string;\n /**\n * The manufacturer of the camera.\n *\n * @since 0.1.0\n * @example 'Apple'\n */\n make?: string;\n /**\n * The model of the camera.\n *\n * @since 0.1.0\n * @example 'iPhone 15 Pro'\n */\n model?: string;\n /**\n * The orientation of the image as defined by the EXIF specification (1-8).\n *\n * @since 0.1.0\n * @example 6\n */\n orientation?: number;\n /**\n * The name of the software that was used to create or edit the image.\n *\n * @since 0.1.0\n * @example 'Adobe Photoshop'\n */\n software?: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface WriteExifOptions {\n /**\n * The path to the image file to write the EXIF metadata to.\n *\n * Local file paths and `file://` URIs are supported.\n *\n * @since 0.1.0\n * @example '/data/user/0/dev.robingenz.capacitor.plugindemo/cache/photo.jpg'\n */\n path: string;\n /**\n * The EXIF tags to write to the image file.\n *\n * Only the provided tags are updated. All other tags remain unchanged.\n *\n * @since 0.1.0\n */\n tags: WritableExifTags;\n}\n\n/**\n * @since 0.1.0\n */\nexport enum ErrorCode {\n /**\n * The file was not found at the provided path.\n *\n * @since 0.1.0\n */\n FileNotFound = 'FILE_NOT_FOUND',\n /**\n * The EXIF metadata could not be read from the file.\n *\n * @since 0.1.0\n */\n ReadFailed = 'READ_FAILED',\n /**\n * The file format does not support writing or removing EXIF metadata\n * on this platform.\n *\n * @since 0.1.0\n */\n UnsupportedFormat = 'UNSUPPORTED_FORMAT',\n /**\n * The EXIF metadata could not be written to the file.\n *\n * @since 0.1.0\n */\n WriteFailed = 'WRITE_FAILED',\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { ExifPlugin } from './definitions';
2
+ declare const Exif: ExifPlugin;
3
+ export * from './definitions';
4
+ export { Exif };
@@ -0,0 +1,7 @@
1
+ import { registerPlugin } from '@capacitor/core';
2
+ const Exif = registerPlugin('Exif', {
3
+ web: () => import('./web').then(m => new m.ExifWeb()),
4
+ });
5
+ export * from './definitions';
6
+ export { Exif };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,IAAI,GAAG,cAAc,CAAa,MAAM,EAAE;IAC9C,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;CACtD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { ExifPlugin } from './definitions';\n\nconst Exif = registerPlugin<ExifPlugin>('Exif', {\n web: () => import('./web').then(m => new m.ExifWeb()),\n});\n\nexport * from './definitions';\nexport { Exif };\n"]}
@@ -0,0 +1,7 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ import type { ExifPlugin, ReadExifResult } from './definitions';
3
+ export declare class ExifWeb extends WebPlugin implements ExifPlugin {
4
+ readExif(): Promise<ReadExifResult>;
5
+ removeExif(): Promise<void>;
6
+ writeExif(): Promise<void>;
7
+ }
@@ -0,0 +1,13 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ export class ExifWeb extends WebPlugin {
3
+ async readExif() {
4
+ throw this.unimplemented('Not implemented on web.');
5
+ }
6
+ async removeExif() {
7
+ throw this.unimplemented('Not implemented on web.');
8
+ }
9
+ async writeExif() {
10
+ throw this.unimplemented('Not implemented on web.');
11
+ }
12
+ }
13
+ //# sourceMappingURL=web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,OAAQ,SAAQ,SAAS;IACpC,KAAK,CAAC,QAAQ;QACZ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,SAAS;QACb,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { ExifPlugin, ReadExifResult } from './definitions';\n\nexport class ExifWeb extends WebPlugin implements ExifPlugin {\n async readExif(): Promise<ReadExifResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async removeExif(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async writeExif(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n"]}
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+
3
+ var core = require('@capacitor/core');
4
+
5
+ /**
6
+ * @since 0.1.0
7
+ */
8
+ exports.ErrorCode = void 0;
9
+ (function (ErrorCode) {
10
+ /**
11
+ * The file was not found at the provided path.
12
+ *
13
+ * @since 0.1.0
14
+ */
15
+ ErrorCode["FileNotFound"] = "FILE_NOT_FOUND";
16
+ /**
17
+ * The EXIF metadata could not be read from the file.
18
+ *
19
+ * @since 0.1.0
20
+ */
21
+ ErrorCode["ReadFailed"] = "READ_FAILED";
22
+ /**
23
+ * The file format does not support writing or removing EXIF metadata
24
+ * on this platform.
25
+ *
26
+ * @since 0.1.0
27
+ */
28
+ ErrorCode["UnsupportedFormat"] = "UNSUPPORTED_FORMAT";
29
+ /**
30
+ * The EXIF metadata could not be written to the file.
31
+ *
32
+ * @since 0.1.0
33
+ */
34
+ ErrorCode["WriteFailed"] = "WRITE_FAILED";
35
+ })(exports.ErrorCode || (exports.ErrorCode = {}));
36
+
37
+ const Exif = core.registerPlugin('Exif', {
38
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.ExifWeb()),
39
+ });
40
+
41
+ class ExifWeb extends core.WebPlugin {
42
+ async readExif() {
43
+ throw this.unimplemented('Not implemented on web.');
44
+ }
45
+ async removeExif() {
46
+ throw this.unimplemented('Not implemented on web.');
47
+ }
48
+ async writeExif() {
49
+ throw this.unimplemented('Not implemented on web.');
50
+ }
51
+ }
52
+
53
+ var web = /*#__PURE__*/Object.freeze({
54
+ __proto__: null,
55
+ ExifWeb: ExifWeb
56
+ });
57
+
58
+ exports.Exif = Exif;
59
+ //# sourceMappingURL=plugin.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 0.1.0\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * The file was not found at the provided path.\n *\n * @since 0.1.0\n */\n ErrorCode[\"FileNotFound\"] = \"FILE_NOT_FOUND\";\n /**\n * The EXIF metadata could not be read from the file.\n *\n * @since 0.1.0\n */\n ErrorCode[\"ReadFailed\"] = \"READ_FAILED\";\n /**\n * The file format does not support writing or removing EXIF metadata\n * on this platform.\n *\n * @since 0.1.0\n */\n ErrorCode[\"UnsupportedFormat\"] = \"UNSUPPORTED_FORMAT\";\n /**\n * The EXIF metadata could not be written to the file.\n *\n * @since 0.1.0\n */\n ErrorCode[\"WriteFailed\"] = \"WRITE_FAILED\";\n})(ErrorCode || (ErrorCode = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst Exif = registerPlugin('Exif', {\n web: () => import('./web').then(m => new m.ExifWeb()),\n});\nexport * from './definitions';\nexport { Exif };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ExifWeb extends WebPlugin {\n async readExif() {\n throw this.unimplemented('Not implemented on web.');\n }\n async removeExif() {\n throw this.unimplemented('Not implemented on web.');\n }\n async writeExif() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ErrorCode","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACWA;AACX,CAAC,UAAU,SAAS,EAAE;AACtB;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,cAAc,CAAC,GAAG,gBAAgB;AAChD;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,YAAY,CAAC,GAAG,aAAa;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,mBAAmB,CAAC,GAAG,oBAAoB;AACzD;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,aAAa,CAAC,GAAG,cAAc;AAC7C,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;;AC7B5B,MAAC,IAAI,GAAGC,mBAAc,CAAC,MAAM,EAAE;AACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AACzD,CAAC;;ACFM,MAAM,OAAO,SAASC,cAAS,CAAC;AACvC,IAAI,MAAM,QAAQ,GAAG;AACrB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,SAAS,GAAG;AACtB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;;;;;;;;;"}
package/dist/plugin.js ADDED
@@ -0,0 +1,62 @@
1
+ var capacitorExif = (function (exports, core) {
2
+ 'use strict';
3
+
4
+ /**
5
+ * @since 0.1.0
6
+ */
7
+ exports.ErrorCode = void 0;
8
+ (function (ErrorCode) {
9
+ /**
10
+ * The file was not found at the provided path.
11
+ *
12
+ * @since 0.1.0
13
+ */
14
+ ErrorCode["FileNotFound"] = "FILE_NOT_FOUND";
15
+ /**
16
+ * The EXIF metadata could not be read from the file.
17
+ *
18
+ * @since 0.1.0
19
+ */
20
+ ErrorCode["ReadFailed"] = "READ_FAILED";
21
+ /**
22
+ * The file format does not support writing or removing EXIF metadata
23
+ * on this platform.
24
+ *
25
+ * @since 0.1.0
26
+ */
27
+ ErrorCode["UnsupportedFormat"] = "UNSUPPORTED_FORMAT";
28
+ /**
29
+ * The EXIF metadata could not be written to the file.
30
+ *
31
+ * @since 0.1.0
32
+ */
33
+ ErrorCode["WriteFailed"] = "WRITE_FAILED";
34
+ })(exports.ErrorCode || (exports.ErrorCode = {}));
35
+
36
+ const Exif = core.registerPlugin('Exif', {
37
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.ExifWeb()),
38
+ });
39
+
40
+ class ExifWeb extends core.WebPlugin {
41
+ async readExif() {
42
+ throw this.unimplemented('Not implemented on web.');
43
+ }
44
+ async removeExif() {
45
+ throw this.unimplemented('Not implemented on web.');
46
+ }
47
+ async writeExif() {
48
+ throw this.unimplemented('Not implemented on web.');
49
+ }
50
+ }
51
+
52
+ var web = /*#__PURE__*/Object.freeze({
53
+ __proto__: null,
54
+ ExifWeb: ExifWeb
55
+ });
56
+
57
+ exports.Exif = Exif;
58
+
59
+ return exports;
60
+
61
+ })({}, capacitorExports);
62
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 0.1.0\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * The file was not found at the provided path.\n *\n * @since 0.1.0\n */\n ErrorCode[\"FileNotFound\"] = \"FILE_NOT_FOUND\";\n /**\n * The EXIF metadata could not be read from the file.\n *\n * @since 0.1.0\n */\n ErrorCode[\"ReadFailed\"] = \"READ_FAILED\";\n /**\n * The file format does not support writing or removing EXIF metadata\n * on this platform.\n *\n * @since 0.1.0\n */\n ErrorCode[\"UnsupportedFormat\"] = \"UNSUPPORTED_FORMAT\";\n /**\n * The EXIF metadata could not be written to the file.\n *\n * @since 0.1.0\n */\n ErrorCode[\"WriteFailed\"] = \"WRITE_FAILED\";\n})(ErrorCode || (ErrorCode = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst Exif = registerPlugin('Exif', {\n web: () => import('./web').then(m => new m.ExifWeb()),\n});\nexport * from './definitions';\nexport { Exif };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ExifWeb extends WebPlugin {\n async readExif() {\n throw this.unimplemented('Not implemented on web.');\n }\n async removeExif() {\n throw this.unimplemented('Not implemented on web.');\n }\n async writeExif() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ErrorCode","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;AACWA;IACX,CAAC,UAAU,SAAS,EAAE;IACtB;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,cAAc,CAAC,GAAG,gBAAgB;IAChD;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,YAAY,CAAC,GAAG,aAAa;IAC3C;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,mBAAmB,CAAC,GAAG,oBAAoB;IACzD;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,aAAa,CAAC,GAAG,cAAc;IAC7C,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;;AC7B5B,UAAC,IAAI,GAAGC,mBAAc,CAAC,MAAM,EAAE;IACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IACzD,CAAC;;ICFM,MAAM,OAAO,SAASC,cAAS,CAAC;IACvC,IAAI,MAAM,QAAQ,GAAG;IACrB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,SAAS,GAAG;IACtB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;;;;;;;;;;;;;;;"}
@@ -0,0 +1,20 @@
1
+ import Foundation
2
+ import Capacitor
3
+
4
+ @objc public class ReadExifOptions: NSObject {
5
+ let url: URL
6
+
7
+ init(_ call: CAPPluginCall) throws {
8
+ self.url = try ReadExifOptions.getUrlFromCall(call)
9
+ }
10
+
11
+ static func getUrlFromCall(_ call: CAPPluginCall) throws -> URL {
12
+ guard let path = call.getString("path"), !path.isEmpty else {
13
+ throw CustomError.pathMissing
14
+ }
15
+ if path.hasPrefix("file://"), let url = URL(string: path) {
16
+ return url
17
+ }
18
+ return URL(fileURLWithPath: path)
19
+ }
20
+ }
@@ -0,0 +1,12 @@
1
+ import Foundation
2
+ import Capacitor
3
+
4
+ @objc public class RemoveExifOptions: NSObject {
5
+ let keepOrientation: Bool
6
+ let url: URL
7
+
8
+ init(_ call: CAPPluginCall) throws {
9
+ self.keepOrientation = call.getBool("keepOrientation", true)
10
+ self.url = try ReadExifOptions.getUrlFromCall(call)
11
+ }
12
+ }