Socket
Socket
Sign inDemoInstall

nativescript-camera

Package Overview
Dependencies
1
Maintainers
11
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.3.0 to 4.4.0

11

camera.ios.js

@@ -26,2 +26,3 @@ "use strict";

this._saveToGallery = options.saveToGallery;
this._allowsEditing = options.allowsEditing;
this._keepAspectRatio = types.isNullOrUndefined(options.keepAspectRatio) ? true : options.keepAspectRatio;

@@ -36,2 +37,5 @@ }

var source = info.valueForKey(UIImagePickerControllerOriginalImage);
if (this._allowsEditing) {
source = info.valueForKey(UIImagePickerControllerEditedImage);
}
if (source) {

@@ -114,2 +118,3 @@ var imageSource = require("image-source");

var saveToGallery = true;
var allowsEditing = false;
if (options) {

@@ -120,2 +125,3 @@ reqWidth = options.width || 0;

saveToGallery = types.isNullOrUndefined(options.saveToGallery) ? saveToGallery : options.saveToGallery;
allowsEditing = types.isNullOrUndefined(options.allowsEditing) ? allowsEditing : options.allowsEditing;
}

@@ -127,6 +133,6 @@ var authStatus = PHPhotoLibrary.authorizationStatus();

if (reqWidth && reqHeight) {
listener = UIImagePickerControllerDelegateImpl.new().initWithCallbackAndOptions(resolve, reject, { width: reqWidth, height: reqHeight, keepAspectRatio: keepAspectRatio, saveToGallery: saveToGallery });
listener = UIImagePickerControllerDelegateImpl.new().initWithCallbackAndOptions(resolve, reject, { width: reqWidth, height: reqHeight, keepAspectRatio: keepAspectRatio, saveToGallery: saveToGallery, allowsEditing: allowsEditing });
}
else if (saveToGallery) {
listener = UIImagePickerControllerDelegateImpl.new().initWithCallbackAndOptions(resolve, reject, { saveToGallery: saveToGallery, keepAspectRatio: keepAspectRatio });
listener = UIImagePickerControllerDelegateImpl.new().initWithCallbackAndOptions(resolve, reject, { saveToGallery: saveToGallery, keepAspectRatio: keepAspectRatio, allowsEditing: allowsEditing });
}

@@ -147,2 +153,3 @@ else {

1 : 0;
imagePickerController.allowsEditing = allowsEditing;
}

@@ -149,0 +156,0 @@ imagePickerController.modalPresentationStyle = 3;

@@ -48,2 +48,8 @@ import imageAsset = require("tns-core-modules/image-asset/image-asset");

/**
* iOS Only
* Defines if camera "Retake" or "Use Photo" screen forces user to crop camera picture to a square and optionally lets them zoom in.
*/
allowsEditing?: boolean;
/**
* The initial camera. Default "rear".

@@ -50,0 +56,0 @@ * The current implementation doesn't work on all Android devices, in which case it falls back to the default behavior.

2

package.json
{
"name": "nativescript-camera",
"version": "4.3.0",
"version": "4.4.0",
"description": "Provides API for using device camera",

@@ -5,0 +5,0 @@ "repository": {

@@ -43,9 +43,10 @@ # NativeScript Camera [![Build Status](https://travis-ci.org/NativeScript/nativescript-camera.svg?branch=master)](https://travis-ci.org/NativeScript/nativescript-camera)

### CameraOptions
| Property | Default | Description |
| --- | --- | --- |
| width | 0 | Defines the desired width (in device independent pixels) of the taken image. It should be used with height property. If `keepAspectRatio` actual image width could be different in order to keep the aspect ratio of the original camera image. The actual image width will be greater than requested if the display density of the device is higher (than 1) (full HD+ resolutions). |
| height | 0 | Defines the desired height (in device independent pixels) of the taken image. It should be used with width property. If `keepAspectRatio` actual image width could be different in order to keep the aspect ratio of the original camera image. The actual image height will be greater than requested if the display density of the device is higher (than 1) (full HD+ resolutions). |
| keepAspectRatio | true | Defines if camera picture aspect ratio should be kept during picture resizing. This property could affect width or height return values. |
| saveToGallery | true | Defines if camera picture should be copied to photo Gallery (Android) or Photos (iOS) |
| cameraFacing | rear | The initial camera facing. Use 'front' for selfies. |
| Property | Default | Platform | Description |
| --- | --- | --- | --- |
| width | 0 | Both | Defines the desired width (in device independent pixels) of the taken image. It should be used with height property. If `keepAspectRatio` actual image width could be different in order to keep the aspect ratio of the original camera image. The actual image width will be greater than requested if the display density of the device is higher (than 1) (full HD+ resolutions). |
| height | 0 | Both | Defines the desired height (in device independent pixels) of the taken image. It should be used with width property. If `keepAspectRatio` actual image width could be different in order to keep the aspect ratio of the original camera image. The actual image height will be greater than requested if the display density of the device is higher (than 1) (full HD+ resolutions). |
| keepAspectRatio | true | Both | Defines if camera picture aspect ratio should be kept during picture resizing. This property could affect width or height return values. |
| saveToGallery | true | Both | Defines if camera picture should be copied to photo Gallery (Android) or Photos (iOS) |
| allowsEditing | false | iOS | Defines if camera "Retake" or "Use Photo" screen forces the user to crop camera picture to a square and optionally lets them zoom in. |
| cameraFacing | rear | Both | The initial camera facing. Use 'front' for selfies. |

@@ -135,2 +136,3 @@

* __saveToGallery__: A boolean parameter that indicates if the original taken photo will be saved in "Photos" for Android and in "Camera Roll" in iOS
* __allowsEditing__: (iOS Only) A boolean parameter that indicates if the camera "Retake" or "Use Photo" screen forces the user to crop camera picture to a square and optionally lets them zoom in.
* __cameraFacing__: Start with either the "front" or "rear" (default) camera of the device. The current implementation doesn't work on all Android devices, in which case it falls back to the default behavior.

@@ -137,0 +139,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc