Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cordova-plugin-camera

Package Overview
Dependencies
Maintainers
16
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-camera - npm Package Compare versions

Comparing version 4.1.0 to 5.0.0

8

CONTRIBUTING.md

@@ -28,11 +28,11 @@ <!--

contribute code.
For instructions on this, start with the
For instructions on this, start with the
[contribution overview](http://cordova.apache.org/contribute/).
The details are explained there, but the important items are:
- Sign and submit an Apache ICLA (Contributor License Agreement).
- Have a Jira issue open that corresponds to your contribution.
- Check for Github issues that corresponds to your contribution and link or create them if necessary.
- Run the tests so your patch doesn't break existing functionality.
We look forward to your contributions!
{
"name": "cordova-plugin-camera",
"version": "4.1.0",
"version": "5.0.0",
"description": "Cordova Camera Plugin",

@@ -16,9 +16,4 @@ "types": "./types/index.d.ts",

},
"repository": {
"type": "git",
"url": "https://github.com/apache/cordova-plugin-camera"
},
"bugs": {
"url": "https://github.com/apache/cordova-plugin-camera/issues"
},
"repository": "github:apache/cordova-plugin-camera",
"bugs": "https://github.com/apache/cordova-plugin-camera/issues",
"keywords": [

@@ -35,4 +30,4 @@ "cordova",

"scripts": {
"test": "npm run eslint",
"eslint": "node node_modules/eslint/bin/eslint www && node node_modules/eslint/bin/eslint src && node node_modules/eslint/bin/eslint tests"
"test": "npm run lint",
"lint": "eslint ."
},

@@ -51,2 +46,7 @@ "author": "Apache Software Foundation",

"5.0.0": {
"cordova-android": ">=9.0.0",
"cordova-ios": ">=5.1.0",
"cordova": ">=9.0.0"
},
"6.0.0": {
"cordova": ">100"

@@ -57,10 +57,4 @@ }

"devDependencies": {
"eslint": "^4.3.0",
"eslint-config-semistandard": "^11.0.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.3.0",
"eslint-plugin-node": "^5.0.0",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1"
"@cordova/eslint-config": "^3.0.0"
}
}

@@ -279,6 +279,2 @@ ---

Defines the output format of `Camera.getPicture` call.
_Note:_ On iOS passing `DestinationType.NATIVE_URI` along with
`PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM` will
disable any image modifications (resize, quality change, cropping, etc.) due
to implementation specific.

@@ -290,5 +286,4 @@ **Kind**: static enum property of <code>[Camera](#module_Camera)</code>

| --- | --- | --- | --- |
| DATA_URL | <code>number</code> | <code>0</code> | Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI or NATIVE_URI if possible |
| DATA_URL | <code>number</code> | <code>0</code> | Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI if possible |
| FILE_URI | <code>number</code> | <code>1</code> | Return file uri (content://media/external/images/media/2 for Android) |
| NATIVE_URI | <code>number</code> | <code>2</code> | Return native uri (eg. asset-library://... for iOS) |

@@ -322,5 +317,2 @@ <a name="module_Camera.EncodingType"></a>

Defines the output format of `Camera.getPicture` call.
_Note:_ On iOS passing `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM`
along with `DestinationType.NATIVE_URI` will disable any image modifications (resize, quality
change, cropping, etc.) due to implementation specific.

@@ -441,3 +433,3 @@ **Kind**: static enum property of <code>[Camera](#module_Camera)</code>

* can result in out of memory errors and application crashes. Use FILE_URI
* or NATIVE_URI instead.
* instead.
*/

@@ -489,7 +481,2 @@ navigator.camera.getPicture(onSuccess, onFail, { quality: 25,

#### Windows Phone 7 Quirks
Invoking the native camera application while the device is connected
via Zune does not work, and triggers an error callback.
#### Windows quirks

@@ -511,3 +498,3 @@

- **`allowEdit` is unpredictable on Android and it should not be used!** The Android implementation of this plugin tries to find and use an application on the user's device to do image cropping. The plugin has no control over what application the user selects to perform the image cropping and it is very possible that the user could choose an incompatible option and cause the plugin to fail. This sometimes works because most devices come with an application that handles cropping in a way that is compatible with this plugin (Google Plus Photos), but it is unwise to rely on that being the case. If image editing is essential to your application, consider seeking a third party library or plugin that provides its own image editing utility for a more robust solution.
- **`allowEdit` is unpredictable on Android and it should not be used!** The Android implementation of this plugin tries to find and use an application on the user's device to do image cropping. The plugin has no control over what application the user selects to perform the image cropping and it is very possible that the user could choose an incompatible option and cause the plugin to fail. This sometimes works because most devices come with an application that handles cropping in a way that is compatible with this plugin (Google Photos), but it is unwise to rely on that being the case. If image editing is essential to your application, consider seeking a third party library or plugin that provides its own image editing utility for a more robust solution.

@@ -522,6 +509,3 @@ - `Camera.PictureSourceType.PHOTOLIBRARY` and `Camera.PictureSourceType.SAVEDPHOTOALBUM` both display the same photo album.

- When using `destinationType.NATIVE_URI` and `sourceType.CAMERA`, photos are saved in the saved photo album regardless on the value of `saveToPhotoAlbum` parameter.
- When using `destinationType.NATIVE_URI` and `sourceType.PHOTOLIBRARY` or `sourceType.SAVEDPHOTOALBUM`, all editing options are ignored and link is returned to original picture.
[android_lifecycle]: http://cordova.apache.org/docs/en/dev/guide/platforms/android/lifecycle.html

@@ -555,3 +539,3 @@

allowEdit: true,
correctOrientation: true //Corrects Android orientation quirks
correctOrientation: true
}

@@ -558,0 +542,0 @@ return options;

@@ -23,2 +23,31 @@ <!--

### 5.0.0 (Sep 14, 2020)
* [GH-648](https://github.com/apache/cordova-plugin-camera/pull/648) ci(travis): update osx xcode image
* [GH-637](https://github.com/apache/cordova-plugin-camera/pull/637) breaking: remove `NATIVE_URI` DestinationType
* [GH-628](https://github.com/apache/cordova-plugin-camera/pull/628) breaking: bump project requirements
* [GH-634](https://github.com/apache/cordova-plugin-camera/pull/634) chore: remove deprecated `file-transfer` plugin
* [GH-632](https://github.com/apache/cordova-plugin-camera/pull/632) fix(android): return error if file url is null
* [GH-510](https://github.com/apache/cordova-plugin-camera/pull/510) fix(android): use provider prefix to avoid conflicts other plugin providers
* [GH-617](https://github.com/apache/cordova-plugin-camera/pull/617) breaking(android): stop using `CordovaUri` helper class
* [GH-630](https://github.com/apache/cordova-plugin-camera/pull/630) chore: add `package-lock.json`
* [GH-631](https://github.com/apache/cordova-plugin-camera/pull/631) chore(package): use short notation
* [GH-629](https://github.com/apache/cordova-plugin-camera/pull/629) feat: migrate to `@cordova/eslint-config@3.x`
* [GH-626](https://github.com/apache/cordova-plugin-camera/pull/626) ci: fix additional tests
* [GH-627](https://github.com/apache/cordova-plugin-camera/pull/627) breaking: bump version 5.0.0-dev
* [GH-612](https://github.com/apache/cordova-plugin-camera/pull/612) fix(ios): `tempFilePath` called twice if using `CameraUsesGeolocation`
### 4.2.0 (May 07, 2020)
* Cache images in device storage, devices have enough space now.
* docs(readme): app renamed to Google Photos
* chore(asf): update git notification settings
* fix(ios): return copy of video when picking from gallery on **iOS** 13 (#580)
* Update CONTRIBUTING.md
* Fix UI API called on a background thread (#550, #530, #447) (#551)
* ci: updates Node.js versions (#576)
* chore(npm): adds ignore list (#575)
* docs(README): remove confusing comment (#513)
* docs(README): remove orphan **Windows** phone 7 note (#512)
* ImagePicker returning same image (#306)
### 4.1.0 (Jun 27, 2019)

@@ -25,0 +54,0 @@

@@ -115,3 +115,3 @@ /*

if (navigator.getUserMedia) {
navigator.getUserMedia({video: true, audio: false}, successCallback, errorCallback);
navigator.getUserMedia({ video: true, audio: false }, successCallback, errorCallback);
} else {

@@ -118,0 +118,0 @@ alert('Browser does not support camera :(');

@@ -193,3 +193,3 @@ /*

}
if (destinationType === Camera.DestinationType.FILE_URI || destinationType === Camera.DestinationType.NATIVE_URI) {
if (destinationType === Camera.DestinationType.FILE_URI) {
if (targetHeight > 0 && targetWidth > 0) {

@@ -200,7 +200,3 @@ resizeImage(successCallback, errorCallback, file, targetWidth, targetHeight, encodingType);

file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).done(function (storageFile) {
if (destinationType === Camera.DestinationType.NATIVE_URI) {
successCallback('ms-appdata:///local/' + storageFile.name);
} else {
successCallback(URL.createObjectURL(storageFile));
}
successCallback(URL.createObjectURL(storageFile));
}, function () {

@@ -264,3 +260,3 @@ errorCallback("Can't access localStorage folder.");

}
if (destinationType === Camera.DestinationType.FILE_URI || destinationType === Camera.DestinationType.NATIVE_URI) {
if (destinationType === Camera.DestinationType.FILE_URI) {
if (targetHeight > 0 && targetWidth > 0) {

@@ -271,7 +267,3 @@ resizeImage(successCallback, errorCallback, file, targetWidth, targetHeight, encodingType);

file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).done(function (storageFile) {
if (destinationType === Camera.DestinationType.NATIVE_URI) {
successCallback('ms-appdata:///local/' + storageFile.name);
} else {
successCallback(URL.createObjectURL(storageFile));
}
successCallback(URL.createObjectURL(storageFile));
}, function () {

@@ -381,3 +373,2 @@ errorCallback("Can't access localStorage folder.");

}).then(function () {
// create focus control if available

@@ -485,3 +476,2 @@ var VideoDeviceController = capture.videoDeviceController;

function captureAction () {
var encodingProperties;

@@ -724,3 +714,3 @@ var fileName;

maxRes = UIMaxRes.highestAvailable;
// Temp fix for CB-10539
// Temp fix for CB-10539
/* else if (totalPixels <= 320 * 240) {

@@ -791,3 +781,3 @@ maxRes = UIMaxRes.verySmallQvga;

var success = function (picture) {
if (options.destinationType === Camera.DestinationType.FILE_URI || options.destinationType === Camera.DestinationType.NATIVE_URI) {
if (options.destinationType === Camera.DestinationType.FILE_URI) {
if (options.targetHeight > 0 && options.targetWidth > 0) {

@@ -823,3 +813,2 @@ resizeImage(successCallback, errorCallback, picture, options.targetWidth, options.targetHeight, options.encodingType);

success(picture);
} else {

@@ -826,0 +815,0 @@ var savePicker = new Windows.Storage.Pickers.FileSavePicker();

@@ -54,4 +54,2 @@ // Type definitions for Apache Cordova Camera plugin

* FILE_URI : 1, Return image file URI
* NATIVE_URI : 2 Return image native URI
* (e.g., assets-library:// on iOS or content:// on Android)
*/

@@ -153,3 +151,2 @@ destinationType?: number;

FILE_URI: number;
NATIVE_URI: number
}

@@ -156,0 +153,0 @@ Direction: {

@@ -29,6 +29,2 @@ /*

* Defines the output format of `Camera.getPicture` call.
* _Note:_ On iOS passing `DestinationType.NATIVE_URI` along with
* `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM` will
* disable any image modifications (resize, quality change, cropping, etc.) due
* to implementation specific.
*

@@ -38,8 +34,6 @@ * @enum {number}

DestinationType: {
/** Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI or NATIVE_URI if possible */
/** Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI if possible */
DATA_URL: 0,
/** Return file uri (content://media/external/images/media/2 for Android) */
FILE_URI: 1,
/** Return native uri (eg. asset-library://... for iOS) */
NATIVE_URI: 2
FILE_URI: 1
},

@@ -69,5 +63,2 @@ /**

* Defines the output format of `Camera.getPicture` call.
* _Note:_ On iOS passing `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM`
* along with `DestinationType.NATIVE_URI` will disable any image modifications (resize, quality
* change, cropping, etc.) due to implementation specific.
*

@@ -74,0 +65,0 @@ * @enum {number}

@@ -61,3 +61,3 @@ /*

this.setPosition = function (popoverOptions) {
var args = [ popoverOptions ];
var args = [popoverOptions];
exec(null, null, 'Camera', 'repositionPopover', args);

@@ -64,0 +64,0 @@ };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc