@capacitor-community/exif 6.0.0 → 8.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.
- package/CapacitorCommunityExif.podspec +1 -1
- package/Package.swift +3 -3
- package/README.md +9 -6
- package/android/build.gradle +12 -12
- package/android/src/main/java/com/ryltsov/alex/plugins/exif/Exif.java +0 -8
- package/android/src/main/java/com/ryltsov/alex/plugins/exif/ExifPlugin.java +0 -4
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +1 -3
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +1 -3
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/ExifPlugin/Exif.swift +1 -1
- package/ios/Sources/ExifPlugin/ExifPlugin.swift +22 -22
- package/package.json +19 -19
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
13
|
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
-
s.ios.deployment_target
|
|
14
|
+
s.ios.deployment_target = '15.0'
|
|
15
15
|
s.dependency 'Capacitor'
|
|
16
16
|
s.swift_version = '5.1'
|
|
17
17
|
end
|
package/Package.swift
CHANGED
|
@@ -3,14 +3,14 @@ import PackageDescription
|
|
|
3
3
|
|
|
4
4
|
let package = Package(
|
|
5
5
|
name: "CapacitorCommunityExif",
|
|
6
|
-
platforms: [.iOS(.
|
|
6
|
+
platforms: [.iOS(.v15)],
|
|
7
7
|
products: [
|
|
8
8
|
.library(
|
|
9
9
|
name: "CapacitorCommunityExif",
|
|
10
10
|
targets: ["ExifPlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git",
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
|
|
14
14
|
],
|
|
15
15
|
targets: [
|
|
16
16
|
.target(
|
|
@@ -25,4 +25,4 @@ let package = Package(
|
|
|
25
25
|
dependencies: ["ExifPlugin"],
|
|
26
26
|
path: "ios/Tests/ExifPluginTests")
|
|
27
27
|
]
|
|
28
|
-
)
|
|
28
|
+
)
|
package/README.md
CHANGED
|
@@ -6,14 +6,13 @@
|
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
|
-
<img src="https://img.shields.io/maintenance/yes/
|
|
10
|
-
<a href="https://github.com/capacitor-community/exif/actions?query=workflow%3A%22CI%22"><img src="https://img.shields.io/github/workflow/status/capacitor-community/exif/CI?style=flat-square" /></a>
|
|
9
|
+
<img src="https://img.shields.io/maintenance/yes/2025?style=flat-square" />
|
|
11
10
|
<a href="https://www.npmjs.com/package/@capacitor-community/exif"><img src="https://img.shields.io/npm/l/@capacitor-community/exif?style=flat-square" /></a>
|
|
12
11
|
<br>
|
|
13
12
|
<a href="https://www.npmjs.com/package/@capacitor-community/exif"><img src="https://img.shields.io/npm/dw/@capacitor-community/exif?style=flat-square" /></a>
|
|
14
13
|
<a href="https://www.npmjs.com/package/@capacitor-community/exif"><img src="https://img.shields.io/npm/v/@capacitor-community/exif?style=flat-square" /></a>
|
|
15
14
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
16
|
-
<a href="#contributors-"><img src="https://img.shields.io/badge/all%20contributors-
|
|
15
|
+
<a href="#contributors-"><img src="https://img.shields.io/badge/all%20contributors-1-orange?style=flat-square" /></a>
|
|
17
16
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
18
17
|
</p>
|
|
19
18
|
|
|
@@ -45,12 +44,14 @@ This plugin has been primarity implemented to enhance other plugins which requir
|
|
|
45
44
|
- support setting coordinates to image files
|
|
46
45
|
- supports Android and iOS platforms
|
|
47
46
|
|
|
48
|
-
**NOTE**: The plugin version
|
|
47
|
+
**NOTE**: The plugin version 8.0.0 is compatible with Capacitor 8
|
|
49
48
|
|
|
50
49
|
## Plugin versions
|
|
51
50
|
|
|
52
51
|
| Capacitor version | Plugin version |
|
|
53
52
|
| ----------------- | -------------- |
|
|
53
|
+
| 8.x | 8.x |
|
|
54
|
+
| 7.x | 7.x |
|
|
54
55
|
| 6.x | 6.x |
|
|
55
56
|
|
|
56
57
|
## Supported Platforms
|
|
@@ -68,7 +69,9 @@ npx cap sync
|
|
|
68
69
|
## Configuration
|
|
69
70
|
|
|
70
71
|
### Android
|
|
72
|
+
|
|
71
73
|
This plugin will use the following project variables (defined in your app's variables.gradle file):
|
|
74
|
+
|
|
72
75
|
```
|
|
73
76
|
androidxExifInterfaceVersion: version of androidx.exifinterface:exifinterface (default: 1.3.6)
|
|
74
77
|
```
|
|
@@ -83,7 +86,6 @@ androidxExifInterfaceVersion: version of androidx.exifinterface:exifinterface (d
|
|
|
83
86
|
|
|
84
87
|
</docgen-index>
|
|
85
88
|
|
|
86
|
-
|
|
87
89
|
<docgen-api>
|
|
88
90
|
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
89
91
|
|
|
@@ -145,6 +147,8 @@ Get the coordinates from the image EXIF metadata.
|
|
|
145
147
|
|
|
146
148
|
## Usage
|
|
147
149
|
|
|
150
|
+
Please also see **example-app** for a complete example.
|
|
151
|
+
|
|
148
152
|
### Set coordinates to image file
|
|
149
153
|
|
|
150
154
|
```
|
|
@@ -169,4 +173,3 @@ const coordinates: {
|
|
|
169
173
|
lng: number;
|
|
170
174
|
} | undefined = await this.exifPlugin.getCoordinates(options);
|
|
171
175
|
```
|
|
172
|
-
|
package/android/build.gradle
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
ext {
|
|
2
2
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.
|
|
4
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.
|
|
5
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
6
|
-
androidxExifInterfaceVersion = project.hasProperty('androidxExifInterfaceVersion') ? rootProject.ext.androidxExifInterfaceVersion : '1.
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
|
|
6
|
+
androidxExifInterfaceVersion = project.hasProperty('androidxExifInterfaceVersion') ? rootProject.ext.androidxExifInterfaceVersion : '1.4.1'
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
buildscript {
|
|
@@ -12,18 +12,18 @@ buildscript {
|
|
|
12
12
|
mavenCentral()
|
|
13
13
|
}
|
|
14
14
|
dependencies {
|
|
15
|
-
classpath 'com.android.tools.build:gradle:8.
|
|
15
|
+
classpath 'com.android.tools.build:gradle:8.13.0'
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
apply plugin: 'com.android.library'
|
|
20
20
|
|
|
21
21
|
android {
|
|
22
|
-
namespace "com.ryltsov.alex.plugins.exif"
|
|
23
|
-
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
22
|
+
namespace = "com.ryltsov.alex.plugins.exif"
|
|
23
|
+
compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
|
|
24
24
|
defaultConfig {
|
|
25
|
-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion :
|
|
26
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
25
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
|
|
26
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
|
|
27
27
|
versionCode 1
|
|
28
28
|
versionName "1.0"
|
|
29
29
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -35,11 +35,11 @@ android {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
lintOptions {
|
|
38
|
-
abortOnError false
|
|
38
|
+
abortOnError = false
|
|
39
39
|
}
|
|
40
40
|
compileOptions {
|
|
41
|
-
sourceCompatibility JavaVersion.
|
|
42
|
-
targetCompatibility JavaVersion.
|
|
41
|
+
sourceCompatibility JavaVersion.VERSION_21
|
|
42
|
+
targetCompatibility JavaVersion.VERSION_21
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -2,15 +2,12 @@ package com.ryltsov.alex.plugins.exif;
|
|
|
2
2
|
|
|
3
3
|
import android.net.Uri;
|
|
4
4
|
import android.util.Log;
|
|
5
|
-
|
|
6
5
|
import androidx.exifinterface.media.ExifInterface;
|
|
7
|
-
|
|
8
6
|
import java.io.IOException;
|
|
9
7
|
|
|
10
8
|
public class Exif {
|
|
11
9
|
|
|
12
10
|
public void setCoordinates(String pathToImage, double latitude, double longitude) throws IOException {
|
|
13
|
-
|
|
14
11
|
Uri fileUri = Uri.parse(pathToImage);
|
|
15
12
|
// Convert the file:// URI to a file path string
|
|
16
13
|
String filePath = fileUri.getPath();
|
|
@@ -19,12 +16,9 @@ public class Exif {
|
|
|
19
16
|
exif.setLatLong(latitude, longitude);
|
|
20
17
|
// Save the changes
|
|
21
18
|
exif.saveAttributes();
|
|
22
|
-
|
|
23
19
|
}
|
|
24
20
|
|
|
25
|
-
|
|
26
21
|
public double[] getCoordinates(String pathToImage) throws IOException {
|
|
27
|
-
|
|
28
22
|
Uri fileUri = Uri.parse(pathToImage);
|
|
29
23
|
// Convert the file:// URI to a file path string
|
|
30
24
|
String filePath = fileUri.getPath();
|
|
@@ -32,7 +26,5 @@ public class Exif {
|
|
|
32
26
|
ExifInterface exif = new ExifInterface(filePath);
|
|
33
27
|
|
|
34
28
|
return exif.getLatLong();
|
|
35
|
-
|
|
36
29
|
}
|
|
37
|
-
|
|
38
30
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
package com.ryltsov.alex.plugins.exif;
|
|
2
2
|
|
|
3
3
|
import android.util.Log;
|
|
4
|
-
|
|
5
4
|
import com.getcapacitor.JSObject;
|
|
6
5
|
import com.getcapacitor.Plugin;
|
|
7
6
|
import com.getcapacitor.PluginCall;
|
|
@@ -17,7 +16,6 @@ public class ExifPlugin extends Plugin {
|
|
|
17
16
|
|
|
18
17
|
@PluginMethod(returnType = PluginMethod.RETURN_PROMISE)
|
|
19
18
|
public void setCoordinates(final PluginCall call) {
|
|
20
|
-
|
|
21
19
|
if (!call.getData().has("pathToImage")) {
|
|
22
20
|
call.reject("Must provide an pathToImage");
|
|
23
21
|
return;
|
|
@@ -48,7 +46,6 @@ public class ExifPlugin extends Plugin {
|
|
|
48
46
|
|
|
49
47
|
@PluginMethod(returnType = PluginMethod.RETURN_PROMISE)
|
|
50
48
|
public void getCoordinates(final PluginCall call) {
|
|
51
|
-
|
|
52
49
|
if (!call.getData().has("pathToImage")) {
|
|
53
50
|
call.reject("Must provide an pathToImage");
|
|
54
51
|
return;
|
|
@@ -75,5 +72,4 @@ public class ExifPlugin extends Plugin {
|
|
|
75
72
|
}
|
|
76
73
|
call.resolve();
|
|
77
74
|
}
|
|
78
|
-
|
|
79
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface GetCoordinatesOptions {\n
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface GetCoordinatesOptions {\n /**\n * The path to the image to get the coordinates from EXIF metadata.\n *\n * @since 6.0.0\n */\n pathToImage: string;\n}\n\nexport interface SetCoordinatesOptions {\n /**\n * The path to the image to set the coordinates to the EXIF metadata.\n *\n * @since 6.0.0\n */\n pathToImage: string;\n\n /**\n * The latitude of the image coordinates.\n *\n * @since 6.0.0\n */\n lat: number;\n\n /**\n * The longitude of the image coordinates.\n *\n * @since 6.0.0\n */\n lng: number;\n}\n\nexport interface ExifPlugin {\n /**\n * Set the coordinates to the image EXIF metadata.\n *\n * @since 6.0.0\n */\n setCoordinates(options: SetCoordinatesOptions): Promise<void>;\n\n /**\n * Get the coordinates from the image EXIF metadata.\n *\n * @since 6.0.0\n */\n getCoordinates(options: GetCoordinatesOptions): Promise<\n | {\n lat: number;\n lng: number;\n }\n | undefined\n >;\n}\n"]}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +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;
|
|
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,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;CACxD,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"]}
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +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;
|
|
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,6DAA6D;IACtD,KAAK,CAAC,cAAc,CAAC,QAA+B;QACzD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,6DAA6D;IACtD,KAAK,CAAC,cAAc,CAAC,QAA+B;QAOzD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { GetCoordinatesOptions, SetCoordinatesOptions, ExifPlugin } from './definitions';\n\nexport class ExifWeb extends WebPlugin implements ExifPlugin {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public async setCoordinates(_options: SetCoordinatesOptions): Promise<void> {\n throw new Error('setCoordinates is not supported on web');\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public async getCoordinates(_options: GetCoordinatesOptions): Promise<\n | {\n lat: number;\n lng: number;\n }\n | undefined\n > {\n throw new Error('getCoordinates is not supported on web');\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var core = require('@capacitor/core');
|
|
6
4
|
|
|
7
5
|
const Exif = core.registerPlugin('Exif', {
|
|
8
|
-
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.ExifWeb()),
|
|
6
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.ExifWeb()),
|
|
9
7
|
});
|
|
10
8
|
|
|
11
9
|
class ExifWeb extends core.WebPlugin {
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async setCoordinates(_options) {\n throw new Error('setCoordinates is not supported on web');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async getCoordinates(_options) {\n throw new Error('getCoordinates is not supported on web');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async setCoordinates(_options) {\n throw new Error('setCoordinates is not supported on web');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async getCoordinates(_options) {\n throw new Error('getCoordinates is not supported on web');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,IAAI,GAAGA,mBAAc,CAAC,MAAM,EAAE;AACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AAC3D,CAAC;;ACFM,MAAM,OAAO,SAASC,cAAS,CAAC;AACvC;AACA,IAAI,MAAM,cAAc,CAAC,QAAQ,EAAE;AACnC,QAAQ,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC;AACjE,IAAI;AACJ;AACA,IAAI,MAAM,cAAc,CAAC,QAAQ,EAAE;AACnC,QAAQ,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC;AACjE,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -2,7 +2,7 @@ var capacitorExif = (function (exports, core) {
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
const Exif = core.registerPlugin('Exif', {
|
|
5
|
-
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.ExifWeb()),
|
|
5
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.ExifWeb()),
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
class ExifWeb extends core.WebPlugin {
|
|
@@ -23,8 +23,6 @@ var capacitorExif = (function (exports, core) {
|
|
|
23
23
|
|
|
24
24
|
exports.Exif = Exif;
|
|
25
25
|
|
|
26
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
27
|
-
|
|
28
26
|
return exports;
|
|
29
27
|
|
|
30
28
|
})({}, capacitorExports);
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async setCoordinates(_options) {\n throw new Error('setCoordinates is not supported on web');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async getCoordinates(_options) {\n throw new Error('getCoordinates is not supported on web');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,IAAI,GAAGA,mBAAc,CAAC,MAAM,EAAE;IACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async setCoordinates(_options) {\n throw new Error('setCoordinates is not supported on web');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async getCoordinates(_options) {\n throw new Error('getCoordinates is not supported on web');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,IAAI,GAAGA,mBAAc,CAAC,MAAM,EAAE;IACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IAC3D,CAAC;;ICFM,MAAM,OAAO,SAASC,cAAS,CAAC;IACvC;IACA,IAAI,MAAM,cAAc,CAAC,QAAQ,EAAE;IACnC,QAAQ,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC;IACjE,IAAI;IACJ;IACA,IAAI,MAAM,cAAc,CAAC,QAAQ,EAAE;IACnC,QAAQ,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC;IACjE,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -14,13 +14,13 @@ public class ExifPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
14
14
|
CAPPluginMethod(name: "setCoordinates", returnType: CAPPluginReturnPromise),
|
|
15
15
|
CAPPluginMethod(name: "getCoordinates", returnType: CAPPluginReturnPromise)
|
|
16
16
|
]
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
// Message constants
|
|
19
|
-
static let
|
|
20
|
-
static let
|
|
21
|
-
static let
|
|
22
|
-
static let
|
|
23
|
-
|
|
19
|
+
static let invalidUrlError = "Invalid URL"
|
|
20
|
+
static let failedToLoadImageError = "Failed to load image"
|
|
21
|
+
static let failedToCreateDestinationImageError = "Failed to create destination image"
|
|
22
|
+
static let failedToSaveImageError = "Failed to save image"
|
|
23
|
+
|
|
24
24
|
private let implementation = Exif()
|
|
25
25
|
|
|
26
26
|
@objc func setCoordinates(_ call: CAPPluginCall) {
|
|
@@ -28,56 +28,56 @@ public class ExifPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
28
28
|
guard let pathToImage = call.options["pathToImage"] as? String else {
|
|
29
29
|
call.reject("Must provide an pathToImage")
|
|
30
30
|
return
|
|
31
|
-
|
|
31
|
+
}
|
|
32
32
|
guard let latitude = call.options["lat"] as? Double else {
|
|
33
33
|
call.reject("Must provide an lat")
|
|
34
34
|
return
|
|
35
|
-
|
|
35
|
+
}
|
|
36
36
|
guard let longitude = call.options["lng"] as? Double else {
|
|
37
37
|
call.reject("Must provide an lng")
|
|
38
38
|
return
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
}
|
|
40
|
+
|
|
41
41
|
do {
|
|
42
42
|
try implementation.setCoordinates(pathToImage, latitude, longitude)
|
|
43
43
|
call.resolve()
|
|
44
44
|
} catch ImageProcessingError.invalidURL {
|
|
45
|
-
call.reject(ExifPlugin.
|
|
45
|
+
call.reject(ExifPlugin.invalidUrlError)
|
|
46
46
|
} catch ImageProcessingError.failedToLoadImage {
|
|
47
|
-
call.reject(ExifPlugin.
|
|
47
|
+
call.reject(ExifPlugin.failedToLoadImageError)
|
|
48
48
|
} catch ImageProcessingError.failedToCreateDestinationImage {
|
|
49
|
-
call.reject(ExifPlugin.
|
|
49
|
+
call.reject(ExifPlugin.failedToCreateDestinationImageError)
|
|
50
50
|
} catch ImageProcessingError.failedToSaveImage {
|
|
51
|
-
call.reject(ExifPlugin.
|
|
51
|
+
call.reject(ExifPlugin.failedToSaveImageError)
|
|
52
52
|
} catch {
|
|
53
53
|
call.reject(error.localizedDescription, nil, error)
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
@objc func getCoordinates(_ call: CAPPluginCall) {
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
guard let pathToImage = call.options["pathToImage"] as? String else {
|
|
61
61
|
call.reject("Must provide an pathToImage")
|
|
62
62
|
return
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
do {
|
|
66
66
|
let coordinates = try implementation.getCoordinates(filePath: pathToImage)
|
|
67
67
|
call.resolve([
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
"lat": coordinates.latitude,
|
|
69
|
+
"lng": coordinates.longitude
|
|
70
70
|
])
|
|
71
71
|
} catch ImageProcessingError.invalidURL {
|
|
72
|
-
call.reject(ExifPlugin.
|
|
72
|
+
call.reject(ExifPlugin.invalidUrlError)
|
|
73
73
|
} catch ImageProcessingError.failedToLoadImage {
|
|
74
|
-
call.reject(ExifPlugin.
|
|
74
|
+
call.reject(ExifPlugin.failedToLoadImageError)
|
|
75
75
|
} catch ImageProcessingError.noGPSData {
|
|
76
76
|
call.resolve()
|
|
77
77
|
} catch {
|
|
78
78
|
call.reject(error.localizedDescription, nil, error)
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor-community/exif",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "This plugin offers utility functions for interacting with image exif metadata",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -43,35 +43,35 @@
|
|
|
43
43
|
"verify:ios": "xcodebuild -scheme CapacitorCommunityExif -destination generic/platform=iOS",
|
|
44
44
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
45
45
|
"verify:web": "npm run build",
|
|
46
|
-
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint --
|
|
47
|
-
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
46
|
+
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- ios/Sources ios/Tests Package.swift",
|
|
47
|
+
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format -- ios/Sources ios/Tests Package.swift",
|
|
48
48
|
"eslint": "eslint . --ext ts",
|
|
49
|
-
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
49
|
+
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
50
50
|
"swiftlint": "node-swiftlint",
|
|
51
51
|
"docgen": "docgen --api ExifPlugin --output-readme README.md --output-json dist/docs.json",
|
|
52
|
-
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.
|
|
52
|
+
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
53
53
|
"clean": "rimraf ./dist",
|
|
54
54
|
"watch": "tsc --watch",
|
|
55
55
|
"prepublishOnly": "npm run build"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@capacitor/android": "^
|
|
59
|
-
"@capacitor/core": "^
|
|
60
|
-
"@capacitor/docgen": "^0.
|
|
61
|
-
"@capacitor/ios": "^
|
|
58
|
+
"@capacitor/android": "^8.0.2",
|
|
59
|
+
"@capacitor/core": "^8.0.2",
|
|
60
|
+
"@capacitor/docgen": "^0.3.1",
|
|
61
|
+
"@capacitor/ios": "^8.0.2",
|
|
62
62
|
"@ionic/eslint-config": "^0.4.0",
|
|
63
|
-
"@ionic/prettier-config": "^
|
|
64
|
-
"@ionic/swiftlint-config": "^
|
|
65
|
-
"eslint": "^8.57.
|
|
66
|
-
"prettier": "
|
|
67
|
-
"prettier-plugin-java": "
|
|
68
|
-
"rimraf": "^
|
|
69
|
-
"rollup": "^
|
|
70
|
-
"swiftlint": "^
|
|
71
|
-
"typescript": "
|
|
63
|
+
"@ionic/prettier-config": "^4.0.0",
|
|
64
|
+
"@ionic/swiftlint-config": "^2.0.0",
|
|
65
|
+
"eslint": "^8.57.1",
|
|
66
|
+
"prettier": "^3.8.1",
|
|
67
|
+
"prettier-plugin-java": "^2.8.1",
|
|
68
|
+
"rimraf": "^6.1.0",
|
|
69
|
+
"rollup": "^4.57.1",
|
|
70
|
+
"swiftlint": "^2.0.0",
|
|
71
|
+
"typescript": "^5.1.6"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@capacitor/core": "
|
|
74
|
+
"@capacitor/core": ">=8.0.0"
|
|
75
75
|
},
|
|
76
76
|
"prettier": "@ionic/prettier-config",
|
|
77
77
|
"swiftlint": "@ionic/swiftlint-config",
|