From cfefa53272d48c0067bd4a71345f1d6b328ff96f Mon Sep 17 00:00:00 2001 From: Connor Pearson Date: Fri, 30 Jun 2017 09:59:27 -0400 Subject: [PATCH 1/8] CB-12593: (android) Fix potential FileProvider conflicts --- plugin.xml | 7 ++++--- src/android/FileProvider.java | 21 +++++++++++++++++++ ...er_paths.xml => camera_provider_paths.xml} | 0 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 src/android/FileProvider.java rename src/android/xml/{provider_paths.xml => camera_provider_paths.xml} (100%) diff --git a/plugin.xml b/plugin.xml index c666ed2..607f03e 100644 --- a/plugin.xml +++ b/plugin.xml @@ -71,13 +71,13 @@ + android:resource="@xml/camera_provider_paths"/> @@ -85,7 +85,8 @@ - + + diff --git a/src/android/FileProvider.java b/src/android/FileProvider.java new file mode 100644 index 0000000..336f93c --- /dev/null +++ b/src/android/FileProvider.java @@ -0,0 +1,21 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*/ +package org.apache.cordova.camera; + +public class FileProvider extends android.support.v4.content.FileProvider {} diff --git a/src/android/xml/provider_paths.xml b/src/android/xml/camera_provider_paths.xml similarity index 100% rename from src/android/xml/provider_paths.xml rename to src/android/xml/camera_provider_paths.xml From 4b276ee5349528758d32737a54eeb67a1891fef7 Mon Sep 17 00:00:00 2001 From: Suraj Pindoria Date: Wed, 24 Jan 2018 14:38:34 -0800 Subject: [PATCH 2/8] CB-13826 Updated version and RELEASENOTES.md for release 4.0.2 --- RELEASENOTES.md | 4 ++++ package.json | 2 +- plugin.xml | 2 +- tests/plugin.xml | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 14cf100..3ba0d58 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -20,6 +20,10 @@ --> # Release Notes +### 4.0.2 (Jan 24, 2018) +* [CB-13781](https://issues.apache.org/jira/browse/CB-13781) (android) Fixed permissions request on **Android** 8 to save a photo into the photo album +* [CB-13747](https://issues.apache.org/jira/browse/CB-13747) Add build-tools-26.0.2 to travis + ### 4.0.1 (Dec 27, 2017) * CB-13701Fix to allow 4.0.0 version install diff --git a/package.json b/package.json index 4e9121f..cfba050 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-camera", - "version": "4.0.2-dev", + "version": "4.0.2", "description": "Cordova Camera Plugin", "types": "./types/index.d.ts", "cordova": { diff --git a/plugin.xml b/plugin.xml index 5497e4c..ba0d13d 100644 --- a/plugin.xml +++ b/plugin.xml @@ -22,7 +22,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:rim="http://www.blackberry.com/ns/widgets" id="cordova-plugin-camera" - version="4.0.2-dev"> + version="4.0.2"> Camera Cordova Camera Plugin Apache 2.0 diff --git a/tests/plugin.xml b/tests/plugin.xml index a64262a..b27b82d 100644 --- a/tests/plugin.xml +++ b/tests/plugin.xml @@ -22,7 +22,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:rim="http://www.blackberry.com/ns/widgets" id="cordova-plugin-camera-tests" - version="4.0.2-dev"> + version="4.0.2"> Cordova Camera Plugin Tests Apache 2.0 From ad8788a5e6acc9984029baf0f937fb73d999bc39 Mon Sep 17 00:00:00 2001 From: Suraj Pindoria Date: Thu, 25 Jan 2018 11:47:20 -0800 Subject: [PATCH 3/8] CB-13826 Incremented plugin version. --- package.json | 2 +- plugin.xml | 2 +- tests/plugin.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index cfba050..07dfa15 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-camera", - "version": "4.0.2", + "version": "4.0.3-dev", "description": "Cordova Camera Plugin", "types": "./types/index.d.ts", "cordova": { diff --git a/plugin.xml b/plugin.xml index ba0d13d..db501d4 100644 --- a/plugin.xml +++ b/plugin.xml @@ -22,7 +22,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:rim="http://www.blackberry.com/ns/widgets" id="cordova-plugin-camera" - version="4.0.2"> + version="4.0.3-dev"> Camera Cordova Camera Plugin Apache 2.0 diff --git a/tests/plugin.xml b/tests/plugin.xml index b27b82d..57bb56c 100644 --- a/tests/plugin.xml +++ b/tests/plugin.xml @@ -22,7 +22,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:rim="http://www.blackberry.com/ns/widgets" id="cordova-plugin-camera-tests" - version="4.0.2"> + version="4.0.3-dev"> Cordova Camera Plugin Tests Apache 2.0 From bf935dfbd2c2a991f6632424243a26858584821b Mon Sep 17 00:00:00 2001 From: Alpesh Patel Date: Thu, 8 Feb 2018 17:42:16 +0530 Subject: [PATCH 4/8] =?UTF-8?q?CB-13415=20(android)=20Importing=20corrupt?= =?UTF-8?q?=20images=20using=20the=20Camera=20plugin=20c=E2=80=A6=20(#309)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * CB-13415 (android) Importing corrupt images using the Camera plugin crashes the app --- src/android/CameraLauncher.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java index a8e6fc4..fbe8470 100644 --- a/src/android/CameraLauncher.java +++ b/src/android/CameraLauncher.java @@ -943,7 +943,12 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect try { fileStream = FileHelper.getInputStreamFromUriString(imageUrl, cordova); image = BitmapFactory.decodeStream(fileStream); - } finally { + } catch (OutOfMemoryError e) { + callbackContext.error(e.getLocalizedMessage()); + } catch (Exception e){ + callbackContext.error(e.getLocalizedMessage()); + } + finally { if (fileStream != null) { try { fileStream.close(); From e25aed97c5122bbd4d72fb5986b2e413293c7b27 Mon Sep 17 00:00:00 2001 From: Tsuruda Date: Mon, 12 Feb 2018 02:22:34 +0900 Subject: [PATCH 5/8] modified init value (#264) --- README.md | 2 +- www/Camera.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 27bf6f5..40ba072 100644 --- a/README.md +++ b/README.md @@ -272,7 +272,7 @@ Optional parameters to customize the camera settings. | quality | number | 50 | Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. (Note that information about the camera's resolution is unavailable.) | | destinationType | [DestinationType](#module_Camera.DestinationType) | FILE_URI | Choose the format of the return value. | | sourceType | [PictureSourceType](#module_Camera.PictureSourceType) | CAMERA | Set the source of the picture. | -| allowEdit | Boolean | true | Allow simple editing of image before selection. | +| allowEdit | Boolean | false | Allow simple editing of image before selection. | | encodingType | [EncodingType](#module_Camera.EncodingType) | JPEG | Choose the returned image file's encoding. | | targetWidth | number | | Width in pixels to scale image. Must be used with `targetHeight`. Aspect ratio remains constant. | | targetHeight | number | | Height in pixels to scale image. Must be used with `targetWidth`. Aspect ratio remains constant. | diff --git a/www/Camera.js b/www/Camera.js index c14e3f3..0eade0f 100644 --- a/www/Camera.js +++ b/www/Camera.js @@ -66,7 +66,7 @@ for (var key in Camera) { * @property {number} [quality=50] - Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. (Note that information about the camera's resolution is unavailable.) * @property {module:Camera.DestinationType} [destinationType=FILE_URI] - Choose the format of the return value. * @property {module:Camera.PictureSourceType} [sourceType=CAMERA] - Set the source of the picture. - * @property {Boolean} [allowEdit=true] - Allow simple editing of image before selection. + * @property {Boolean} [allowEdit=false] - Allow simple editing of image before selection. * @property {module:Camera.EncodingType} [encodingType=JPEG] - Choose the returned image file's encoding. * @property {number} [targetWidth] - Width in pixels to scale image. Must be used with `targetHeight`. Aspect ratio remains constant. * @property {number} [targetHeight] - Height in pixels to scale image. Must be used with `targetWidth`. Aspect ratio remains constant. From 7c90555bd4bfbbdfe23f357f130eb1bbb7e4fce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20C=C3=A9sar?= Date: Sun, 11 Feb 2018 13:08:40 +0100 Subject: [PATCH 6/8] CB-13854(ios): fix Camera opens in portrait orientation on iphones --- src/ios/CDVCamera.m | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m index 37b4ec8..c71de05 100644 --- a/src/ios/CDVCamera.m +++ b/src/ios/CDVCamera.m @@ -206,6 +206,7 @@ static NSString* toBase64(NSData* data) { [weakSelf displayPopover:pictureOptions.popoverOptions]; weakSelf.hasPendingOperation = NO; } else { + cameraPicker.modalPresentationStyle = UIModalPresentationCurrentContext; [weakSelf.viewController presentViewController:cameraPicker animated:YES completion:^{ weakSelf.hasPendingOperation = NO; }]; From e36482c7ba1e5dec07f68a246f3ecde8743d7cd6 Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Mon, 12 Feb 2018 10:36:58 +0100 Subject: [PATCH 7/8] Fix a mistake in the examples of usage descriptions (#313) --- README.md | 4 ++-- jsdoc2md/TEMPLATE.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 40ba072..4465117 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ To add these entries into the `info.plist`, you can use the `edit-config` tag in ``` - need to photo library access to get pictures from there + need photo library access to get pictures from there ``` @@ -107,7 +107,7 @@ To add these entries into the `info.plist`, you can use the `edit-config` tag in ``` - need to photo library access to save pictures there + need photo library access to save pictures there ``` diff --git a/jsdoc2md/TEMPLATE.md b/jsdoc2md/TEMPLATE.md index d2e6b22..1947193 100644 --- a/jsdoc2md/TEMPLATE.md +++ b/jsdoc2md/TEMPLATE.md @@ -37,7 +37,7 @@ To add these entries into the `info.plist`, you can use the `edit-config` tag in ``` - need to photo library access to get pictures from there + need photo library access to get pictures from there ``` @@ -49,7 +49,7 @@ To add these entries into the `info.plist`, you can use the `edit-config` tag in ``` - need to photo library access to save pictures there + need photo library access to save pictures there ``` From 9d05a1e58fc869d3f58102724bfe377f56a4067c Mon Sep 17 00:00:00 2001 From: Steve Gill Date: Thu, 12 Apr 2018 17:06:17 -0700 Subject: [PATCH 8/8] CB-14030 Updated version and RELEASENOTES.md for release 4.0.3 (via coho) --- RELEASENOTES.md | 6 ++++++ package.json | 2 +- tests/plugin.xml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 3ba0d58..9849f41 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -20,6 +20,12 @@ --> # Release Notes +### 4.0.3 (Apr 12, 2018) +* [CB-12593](https://issues.apache.org/jira/browse/CB-12593) **Android** Fix potential `FileProvider` conflicts +* Fix a mistake in the examples of usage descriptions (#313) +* CB-13854(ios): fix Camera opens in portrait orientation on iphones +* [CB-13415](https://issues.apache.org/jira/browse/CB-13415) **Android** Importing corrupt images using the Camera plugin crashes the app + ### 4.0.2 (Jan 24, 2018) * [CB-13781](https://issues.apache.org/jira/browse/CB-13781) (android) Fixed permissions request on **Android** 8 to save a photo into the photo album * [CB-13747](https://issues.apache.org/jira/browse/CB-13747) Add build-tools-26.0.2 to travis diff --git a/package.json b/package.json index 07dfa15..7ba7faf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-camera", - "version": "4.0.3-dev", + "version": "4.0.3", "description": "Cordova Camera Plugin", "types": "./types/index.d.ts", "cordova": { diff --git a/tests/plugin.xml b/tests/plugin.xml index 57bb56c..622e21f 100644 --- a/tests/plugin.xml +++ b/tests/plugin.xml @@ -22,7 +22,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:rim="http://www.blackberry.com/ns/widgets" id="cordova-plugin-camera-tests" - version="4.0.3-dev"> + version="4.0.3"> Cordova Camera Plugin Tests Apache 2.0