@capacitor/camera 4.1.5-nightly-20230316T150919.0 → 4.1.5

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.1.5](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/camera@4.1.4...@capacitor/camera@4.1.5) (2023-04-26)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **camera:** prevent iOS crash with 0 limited images selected ([#1495](https://github.com/ionic-team/capacitor-plugins/issues/1495)) ([#1499](https://github.com/ionic-team/capacitor-plugins/issues/1499)) ([188b933](https://github.com/ionic-team/capacitor-plugins/commit/188b933050dd5660ba7893de6f4b96f95ee763c6))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [4.1.4](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/camera@4.1.3...@capacitor/camera@4.1.4) (2022-11-16)
7
18
 
8
19
  **Note:** Version bump only for package @capacitor/camera
package/README.md CHANGED
@@ -38,8 +38,8 @@ Additionally, because the Camera API launches a separate Activity to handle taki
38
38
 
39
39
  This plugin will use the following project variables (defined in your app's `variables.gradle` file):
40
40
 
41
- - `$androidxExifInterfaceVersion`: version of `androidx.exifinterface:exifinterface` (default: `1.3.6`)
42
- - `$androidxMaterialVersion`: version of `com.google.android.material:material` (default: `1.8.0`)
41
+ - `$androidxExifInterfaceVersion`: version of `androidx.exifinterface:exifinterface` (default: `1.3.3`)
42
+ - `$androidxMaterialVersion`: version of `com.google.android.material:material` (default: `1.6.1`)
43
43
 
44
44
  ## PWA Notes
45
45
 
@@ -1,11 +1,11 @@
1
1
  ext {
2
2
  capacitorVersion = System.getenv('CAPACITOR_VERSION')
3
3
  junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
4
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
4
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
5
5
  androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
6
- androidxExifInterfaceVersion = project.hasProperty('androidxExifInterfaceVersion') ? rootProject.ext.androidxExifInterfaceVersion : '1.3.6'
6
+ androidxExifInterfaceVersion = project.hasProperty('androidxExifInterfaceVersion') ? rootProject.ext.androidxExifInterfaceVersion : '1.3.3'
7
7
  androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
8
- androidxMaterialVersion = project.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.8.0'
8
+ androidxMaterialVersion = project.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.6.1'
9
9
  }
10
10
 
11
11
  buildscript {
@@ -32,10 +32,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
32
32
  }
33
33
 
34
34
  android {
35
- compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
35
+ compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
36
36
  defaultConfig {
37
37
  minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
38
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
38
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
39
39
  versionCode 1
40
40
  versionName "1.0"
41
41
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -746,11 +746,9 @@ public class CameraPlugin extends Plugin {
746
746
  // first, extract the permissions being requested
747
747
  JSArray providedPerms = call.getArray("permissions");
748
748
  List<String> permsList = null;
749
- if (providedPerms != null) {
750
- try {
751
- permsList = providedPerms.toList();
752
- } catch (JSONException e) {}
753
- }
749
+ try {
750
+ permsList = providedPerms.toList();
751
+ } catch (JSONException e) {}
754
752
 
755
753
  if (permsList != null && permsList.size() == 1 && permsList.contains(CAMERA)) {
756
754
  // the only thing being asked for was the camera so we can just return the current state
@@ -27,8 +27,11 @@ extension PHAuthorizationStatus: CameraAuthorizationState {
27
27
  return "denied"
28
28
  case .authorized:
29
29
  return "granted"
30
+ #if swift(>=5.3)
31
+ // poor proxy for Xcode 12/iOS 14, should be removed once building with Xcode 12 is required
30
32
  case .limited:
31
33
  return "limited"
34
+ #endif
32
35
  case .notDetermined:
33
36
  fallthrough
34
37
  @unknown default:
@@ -109,19 +109,20 @@ public class CameraPlugin: CAPPlugin {
109
109
  options.deliveryMode = .highQualityFormat
110
110
 
111
111
  let group = DispatchGroup()
112
-
113
- for index in 0...(assets.count - 1) {
114
- let asset = assets.object(at: index)
115
- let fullSize = CGSize(width: asset.pixelWidth, height: asset.pixelHeight)
116
-
117
- group.enter()
118
- imageManager.requestImage(for: asset, targetSize: fullSize, contentMode: .default, options: options) { image, _ in
119
- guard let image = image else {
112
+ if assets.count > 0 {
113
+ for index in 0...(assets.count - 1) {
114
+ let asset = assets.object(at: index)
115
+ let fullSize = CGSize(width: asset.pixelWidth, height: asset.pixelHeight)
116
+
117
+ group.enter()
118
+ imageManager.requestImage(for: asset, targetSize: fullSize, contentMode: .default, options: options) { image, _ in
119
+ guard let image = image else {
120
+ group.leave()
121
+ return
122
+ }
123
+ processedImages.append(self.processedImage(from: image, with: asset.imageData))
120
124
  group.leave()
121
- return
122
125
  }
123
- processedImages.append(self.processedImage(from: image, with: asset.imageData))
124
- group.leave()
125
126
  }
126
127
  }
127
128
 
@@ -4,7 +4,7 @@ class ImageSaver: NSObject {
4
4
 
5
5
  var onResult: ((Error?) -> Void) = {_ in }
6
6
 
7
- init(image: UIImage, onResult:@escaping ((Error?) -> Void)) {
7
+ init(image: UIImage, onResult: @escaping ((Error?) -> Void)) {
8
8
  self.onResult = onResult
9
9
  super.init()
10
10
  UIImageWriteToSavedPhotosAlbum(image, self, #selector(saveResult), nil)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/camera",
3
- "version": "4.1.5-nightly-20230316T150919.0",
3
+ "version": "4.1.5",
4
4
  "description": "The Camera API provides the ability to take a photo with the camera or choose an existing one from the photo album.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -79,5 +79,5 @@
79
79
  "publishConfig": {
80
80
  "access": "public"
81
81
  },
82
- "gitHead": "f2a70219bafbcbe136758c10bb43746f95a9e336"
82
+ "gitHead": "50d5147d21c0fb915be8894a3a2846ae02389376"
83
83
  }