Compare commits

..

21 Commits
4.0.0 ... 4.0.3

Author SHA1 Message Date
Steve Gill
6ce1443622 fixed issue with version, 4.0.3 2018-04-12 18:04:49 -07:00
Steve Gill
37e12e85fb Set VERSION to 4.0.4-dev (via coho) 2018-04-12 17:16:12 -07:00
Steve Gill
9d05a1e58f CB-14030 Updated version and RELEASENOTES.md for release 4.0.3 (via coho) 2018-04-12 17:06:17 -07:00
Joe Bowser
c8581ba2c9 Merge pull request #275 from cjpearson/CB12953
CB-12593: (android) Fix potential FileProvider conflicts
2018-03-14 12:44:35 -07:00
jcesarmobile
e36482c7ba Fix a mistake in the examples of usage descriptions (#313) 2018-02-12 10:36:58 +01:00
Julio César
7c90555bd4 CB-13854(ios): fix Camera opens in portrait orientation on iphones 2018-02-11 21:44:56 -05:00
Tsuruda
e25aed97c5 modified init value (#264) 2018-02-11 18:22:34 +01:00
Alpesh Patel
bf935dfbd2 CB-13415 (android) Importing corrupt images using the Camera plugin c… (#309)
* CB-13415 (android) Importing corrupt images using the Camera plugin crashes the app
2018-02-08 13:12:16 +01:00
Suraj Pindoria
ad8788a5e6 CB-13826 Incremented plugin version. 2018-01-25 11:47:20 -08:00
Suraj Pindoria
4b276ee534 CB-13826 Updated version and RELEASENOTES.md for release 4.0.2 2018-01-25 11:40:16 -08:00
Joe Bowser
4b99623eda Merge pull request #308 from okode/android8_permission_request_fix
CB-13781: (android) Fixed permissions request on Android 8 to save a …
2018-01-15 14:13:07 -08:00
rpanadero
36ea63a60f CB-13781: (android) Fixed permissions request on Android 8 to save a photo into the photo album 2018-01-15 13:05:10 +01:00
jcesarmobile
e6a4738031 Merge pull request #307 from jcesarmobile/CB-13747
CB-13747: Add build-tools-26.0.2 to travis
2018-01-10 23:46:04 +01:00
Julio César
c46fe3b31d CB-13747: Add build-tools-26.0.2 to travis 2018-01-09 20:32:55 +01:00
jcesarmobile
67718544a8 Fix release notes (#304) 2017-12-30 00:59:38 -05:00
Simon MacDonald
b00cf97a04 Set VERSION to 4.0.2-dev (via coho) 2017-12-27 19:13:49 -05:00
Simon MacDonald
fb02f48745 CB-13714 Updated version and RELEASENOTES.md for release 4.0.1 (via coho) 2017-12-27 19:13:36 -05:00
jcesarmobile
6bf45f005a Merge pull request #303 from jcesarmobile/CB-13701
CB-13701 Fix to allow 4.0.0 version install
2017-12-27 10:55:32 +01:00
Julio César
96b7f55ec2 CB-13701Fix to allow 4.0.0 version install 2017-12-27 00:00:45 +01:00
Steve Gill
82f1c83a76 Set VERSION to 4.0.1-dev (via coho) 2017-12-15 17:26:41 -08:00
Connor Pearson
cfefa53272 CB-12593: (android) Fix potential FileProvider conflicts 2017-06-30 10:15:43 -04:00
12 changed files with 66 additions and 19 deletions

View File

@@ -46,6 +46,7 @@ matrix:
components:
- tools
- extra-android-m2repository
- build-tools-26.0.2
- env: PLATFORM=android-5.1
os: linux
language: android
@@ -54,6 +55,7 @@ matrix:
components:
- tools
- extra-android-m2repository
- build-tools-26.0.2
- env: PLATFORM=android-6.0
os: linux
language: android
@@ -62,6 +64,7 @@ matrix:
components:
- tools
- extra-android-m2repository
- build-tools-26.0.2
- env: PLATFORM=android-7.0
os: linux
language: android
@@ -70,6 +73,7 @@ matrix:
components:
- tools
- extra-android-m2repository
- build-tools-26.0.2
before_install:
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- node --version

View File

@@ -95,7 +95,7 @@ To add these entries into the `info.plist`, you can use the `edit-config` tag in
```
<edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
<string>need to photo library access to get pictures from there</string>
<string>need photo library access to get pictures from there</string>
</edit-config>
```
@@ -107,7 +107,7 @@ To add these entries into the `info.plist`, you can use the `edit-config` tag in
```
<edit-config target="NSPhotoLibraryAddUsageDescription" file="*-Info.plist" mode="merge">
<string>need to photo library access to save pictures there</string>
<string>need photo library access to save pictures there</string>
</edit-config>
```
@@ -272,7 +272,7 @@ Optional parameters to customize the camera settings.
| quality | <code>number</code> | <code>50</code> | 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 | <code>[DestinationType](#module_Camera.DestinationType)</code> | <code>FILE_URI</code> | Choose the format of the return value. |
| sourceType | <code>[PictureSourceType](#module_Camera.PictureSourceType)</code> | <code>CAMERA</code> | Set the source of the picture. |
| allowEdit | <code>Boolean</code> | <code>true</code> | Allow simple editing of image before selection. |
| allowEdit | <code>Boolean</code> | <code>false</code> | Allow simple editing of image before selection. |
| encodingType | <code>[EncodingType](#module_Camera.EncodingType)</code> | <code>JPEG</code> | Choose the returned image file's encoding. |
| targetWidth | <code>number</code> | | Width in pixels to scale image. Must be used with `targetHeight`. Aspect ratio remains constant. |
| targetHeight | <code>number</code> | | Height in pixels to scale image. Must be used with `targetWidth`. Aspect ratio remains constant. |

View File

@@ -7,9 +7,9 @@
# 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
@@ -20,6 +20,19 @@
-->
# 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
### 4.0.1 (Dec 27, 2017)
* CB-13701Fix to allow 4.0.0 version install
### 4.0.0 (Dec 15, 2017)
* [CB-13661](https://issues.apache.org/jira/browse/CB-13661) Remove deprecated platforms

View File

@@ -37,7 +37,7 @@ To add these entries into the `info.plist`, you can use the `edit-config` tag in
```
<edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
<string>need to photo library access to get pictures from there</string>
<string>need photo library access to get pictures from there</string>
</edit-config>
```
@@ -49,7 +49,7 @@ To add these entries into the `info.plist`, you can use the `edit-config` tag in
```
<edit-config target="NSPhotoLibraryAddUsageDescription" file="*-Info.plist" mode="merge">
<string>need to photo library access to save pictures there</string>
<string>need photo library access to save pictures there</string>
</edit-config>
```

View File

@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-camera",
"version": "4.0.0",
"version": "4.0.3",
"description": "Cordova Camera Plugin",
"types": "./types/index.d.ts",
"cordova": {
@@ -43,7 +43,7 @@
"3.0.0": {
"cordova-android": ">=6.3.0"
},
"4.0.0": {
"5.0.0": {
"cordova": ">100"
}
}

View File

@@ -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.0">
version="4.0.3">
<name>Camera</name>
<description>Cordova Camera Plugin</description>
<license>Apache 2.0</license>
@@ -60,13 +60,13 @@
</config-file>
<config-file target="AndroidManifest.xml" parent="application">
<provider
android:name="android.support.v4.content.FileProvider"
android:name="org.apache.cordova.camera.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true" >
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
android:resource="@xml/camera_provider_paths"/>
</provider>
</config-file>
@@ -74,7 +74,8 @@
<source-file src="src/android/CordovaUri.java" target-dir="src/org/apache/cordova/camera" />
<source-file src="src/android/FileHelper.java" target-dir="src/org/apache/cordova/camera" />
<source-file src="src/android/ExifHelper.java" target-dir="src/org/apache/cordova/camera" />
<source-file src="src/android/xml/provider_paths.xml" target-dir="res/xml" />
<source-file src="src/android/FileProvider.java" target-dir="src/org/apache/cordova/camera" />
<source-file src="src/android/xml/camera_provider_paths.xml" target-dir="res/xml" />
<js-module src="www/CameraPopoverHandle.js" name="CameraPopoverHandle">
<clobbers target="CameraPopoverHandle" />

View File

@@ -113,7 +113,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
private boolean orientationCorrected; // Has the picture's orientation been corrected
private boolean allowEdit; // Should we allow the user to crop the image.
protected final static String[] permissions = { Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE };
protected final static String[] permissions = { Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE };
public CallbackContext callbackContext;
private int numPics;
@@ -245,7 +245,8 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
* @param encodingType Compression quality hint (0-100: 0=low quality & high compression, 100=compress of max quality)
*/
public void callTakePicture(int returnType, int encodingType) {
boolean saveAlbumPermission = PermissionHelper.hasPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);
boolean saveAlbumPermission = PermissionHelper.hasPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)
&& PermissionHelper.hasPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
boolean takePicturePermission = PermissionHelper.hasPermission(this, Manifest.permission.CAMERA);
// CB-10120: The CAMERA permission does not need to be requested unless it is declared
@@ -276,7 +277,8 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
} else if (saveAlbumPermission && !takePicturePermission) {
PermissionHelper.requestPermission(this, TAKE_PIC_SEC, Manifest.permission.CAMERA);
} else if (!saveAlbumPermission && takePicturePermission) {
PermissionHelper.requestPermission(this, TAKE_PIC_SEC, Manifest.permission.READ_EXTERNAL_STORAGE);
PermissionHelper.requestPermissions(this, TAKE_PIC_SEC,
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE});
} else {
PermissionHelper.requestPermissions(this, TAKE_PIC_SEC, permissions);
}
@@ -941,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();

View File

@@ -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 {}

View File

@@ -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;
}];

View File

@@ -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.0">
version="4.0.3">
<name>Cordova Camera Plugin Tests</name>
<license>Apache 2.0</license>

View File

@@ -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.