@capacitor-community/exif 7.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.
@@ -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.0'
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(.v14)],
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", from: "7.0.0")
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,7 +6,7 @@
6
6
  </p>
7
7
 
8
8
  <p align="center">
9
- <img src="https://img.shields.io/maintenance/yes/2024?style=flat-square" />
9
+ <img src="https://img.shields.io/maintenance/yes/2025?style=flat-square" />
10
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>
11
11
  <br>
12
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>
@@ -44,12 +44,13 @@ This plugin has been primarity implemented to enhance other plugins which requir
44
44
  - support setting coordinates to image files
45
45
  - supports Android and iOS platforms
46
46
 
47
- **NOTE**: The plugin version 7.0.0 is compatible with Capacitor 7
47
+ **NOTE**: The plugin version 8.0.0 is compatible with Capacitor 8
48
48
 
49
49
  ## Plugin versions
50
50
 
51
51
  | Capacitor version | Plugin version |
52
52
  | ----------------- | -------------- |
53
+ | 8.x | 8.x |
53
54
  | 7.x | 7.x |
54
55
  | 6.x | 6.x |
55
56
 
@@ -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.7.0'
4
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
5
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
6
- androidxExifInterfaceVersion = project.hasProperty('androidxExifInterfaceVersion') ? rootProject.ext.androidxExifInterfaceVersion : '1.3.7'
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.7.2'
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 : 35
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 : 23
26
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
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,7 +35,7 @@ android {
35
35
  }
36
36
  }
37
37
  lintOptions {
38
- abortOnError false
38
+ abortOnError = false
39
39
  }
40
40
  compileOptions {
41
41
  sourceCompatibility JavaVersion.VERSION_21
@@ -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\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}\n\nexport interface SetCoordinatesOptions {\n\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}\n\nexport interface ExifPlugin {\n\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 lat: number;\n lng: number;\n } | undefined>;\n\n}\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
@@ -1,6 +1,6 @@
1
1
  import { registerPlugin } from '@capacitor/core';
2
2
  const Exif = registerPlugin('Exif', {
3
- web: () => import('./web').then(m => new m.ExifWeb()),
3
+ web: () => import('./web').then((m) => new m.ExifWeb()),
4
4
  });
5
5
  export * from './definitions';
6
6
  export { Exif };
@@ -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;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"]}
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"]}
@@ -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;IAEpC,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;QAIzD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;CAEF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { GetCoordinatesOptions, SetCoordinatesOptions, ExifPlugin } from './definitions';\n\nexport class ExifWeb extends WebPlugin implements ExifPlugin {\n\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 lat: number;\n lng: number;\n } | undefined> {\n throw new Error('getCoordinates is not supported on web');\n }\n\n}\n"]}
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"]}
@@ -3,7 +3,7 @@
3
3
  var core = require('@capacitor/core');
4
4
 
5
5
  const Exif = core.registerPlugin('Exif', {
6
- 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()),
7
7
  });
8
8
 
9
9
  class ExifWeb extends core.WebPlugin {
@@ -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":";;;;AACK,MAAC,IAAI,GAAGA,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;AACA,IAAI,MAAM,cAAc,CAAC,QAAQ,EAAE;AACnC,QAAQ,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC;AACjE;AACA;AACA,IAAI,MAAM,cAAc,CAAC,QAAQ,EAAE;AACnC,QAAQ,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC;AACjE;AACA;;;;;;;;;"}
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 {
@@ -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,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IACzD,CAAC;;ICFM,MAAM,OAAO,SAASC,cAAS,CAAC;IACvC;IACA,IAAI,MAAM,cAAc,CAAC,QAAQ,EAAE;IACnC,QAAQ,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC;IACjE;IACA;IACA,IAAI,MAAM,cAAc,CAAC,QAAQ,EAAE;IACnC,QAAQ,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC;IACjE;IACA;;;;;;;;;;;;;;;"}
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;;;;;;;;;;;;;;;"}
@@ -60,7 +60,7 @@ public enum ImageProcessingError: Error {
60
60
 
61
61
  // print("Successfully saved image with updated metadata")
62
62
  }
63
-
63
+
64
64
  func getCoordinates(filePath: String) throws -> CLLocationCoordinate2D {
65
65
 
66
66
  // Convert the file path to a URL
@@ -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 INVALID_URL_ERROR = "Invalid URL";
20
- static let FAILED_TO_LOAD_IMAGE_ERROR = "Failed to load image";
21
- static let FAILED_TO_CREATE_DESTINATION_IMAGE_ERROR = "Failed to create destination image";
22
- static let FAILED_TO_SAVE_IMAGE_ERROR = "Failed to save image";
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.INVALID_URL_ERROR)
45
+ call.reject(ExifPlugin.invalidUrlError)
46
46
  } catch ImageProcessingError.failedToLoadImage {
47
- call.reject(ExifPlugin.FAILED_TO_LOAD_IMAGE_ERROR)
47
+ call.reject(ExifPlugin.failedToLoadImageError)
48
48
  } catch ImageProcessingError.failedToCreateDestinationImage {
49
- call.reject(ExifPlugin.FAILED_TO_CREATE_DESTINATION_IMAGE_ERROR)
49
+ call.reject(ExifPlugin.failedToCreateDestinationImageError)
50
50
  } catch ImageProcessingError.failedToSaveImage {
51
- call.reject(ExifPlugin.FAILED_TO_SAVE_IMAGE_ERROR)
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
- "lat": coordinates.latitude,
69
- "lng": coordinates.longitude
68
+ "lat": coordinates.latitude,
69
+ "lng": coordinates.longitude
70
70
  ])
71
71
  } catch ImageProcessingError.invalidURL {
72
- call.reject(ExifPlugin.INVALID_URL_ERROR)
72
+ call.reject(ExifPlugin.invalidUrlError)
73
73
  } catch ImageProcessingError.failedToLoadImage {
74
- call.reject(ExifPlugin.FAILED_TO_LOAD_IMAGE_ERROR)
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": "7.0.0",
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,8 +43,8 @@
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 -- lint",
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
49
  "prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
50
50
  "swiftlint": "node-swiftlint",
@@ -55,23 +55,23 @@
55
55
  "prepublishOnly": "npm run build"
56
56
  },
57
57
  "devDependencies": {
58
- "@capacitor/android": "^7.0.0",
59
- "@capacitor/core": "^7.0.0",
60
- "@capacitor/docgen": "^0.3.0",
61
- "@capacitor/ios": "^7.0.0",
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
63
  "@ionic/prettier-config": "^4.0.0",
64
64
  "@ionic/swiftlint-config": "^2.0.0",
65
- "eslint": "^8.57.0",
66
- "prettier": "^3.4.2",
67
- "prettier-plugin-java": "^2.6.6",
68
- "rimraf": "^6.0.1",
69
- "rollup": "^4.30.1",
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
70
  "swiftlint": "^2.0.0",
71
- "typescript": "~4.1.5"
71
+ "typescript": "^5.1.6"
72
72
  },
73
73
  "peerDependencies": {
74
- "@capacitor/core": ">=7.0.0"
74
+ "@capacitor/core": ">=8.0.0"
75
75
  },
76
76
  "prettier": "@ionic/prettier-config",
77
77
  "swiftlint": "@ionic/swiftlint-config",