nativescript-camera
Advanced tools
Comparing version 4.0.1 to 4.0.2
{ | ||
"name": "nativescript-camera", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "Provides API for using device camera", | ||
@@ -57,2 +57,2 @@ "repository": { | ||
"license": "Apache-2.0" | ||
} | ||
} |
@@ -0,8 +1,9 @@ | ||
# NativeScript Camera [![Build Status](https://travis-ci.org/NativeScript/nativescript-camera.svg?branch=master)](https://travis-ci.org/NativeScript/nativescript-camera) | ||
Welcome to the `nativescript-camera` plugin for NativeScript framework | ||
# Prerequisites | ||
## (Optional) Prerequisites / Requirements | ||
- installed [NativeScript-CLI](https://github.com/NativeScript/nativescript-cli) | ||
# Working with the camera plugin | ||
@@ -15,3 +16,3 @@ | ||
### Installation | ||
## Installation | ||
@@ -30,2 +31,26 @@ Navigate to project folder and run NativeScript-CLI command | ||
## API | ||
### Methods | ||
| Method | Description | | ||
| --- | --- | | ||
| takePicture(options?: CameraOptions) | Take a photo using the camera with an optional parameter for setting different camera options. | | ||
| requestPermissions() | Check required permissions for using device camera. | | ||
| isAvailable() | Is the device camera available to use. | | ||
### 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. | | ||
> Note: The `saveToGallery` option might have unexpected behavior on Android! Some vendor camera apps (e.g. LG) will save all captured images to the gallery regardless of what the value of `saveToGallery` is. This behavior cannot be controlled by the camera plugin and if you must exclude the captured image from the photo gallery, you will need to get a local storage read/write permission and write custom code to find the gallery location and delete the new image from there. | ||
## Usage | ||
### Requesting permissions | ||
@@ -72,3 +97,3 @@ | ||
import { Image } from "ui/image"; | ||
camera.takePicture({). | ||
camera.takePicture(). | ||
then((imageAsset) => { | ||
@@ -138,1 +163,9 @@ console.log("Result is an image asset instance"); | ||
> Note: This method will return false when used in iOS simulator (as the simulator does not have camera hardware) | ||
## Contribute | ||
We love PRs! Check out the [contributing guidelines](CONTRIBUTING.md). If you want to contribute, but you are not sure where to start - look for [issues labeled `help wanted`](https://github.com/NativeScript/nativescript-camera/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). | ||
## Get Help | ||
Please, use [github issues](https://github.com/NativeScript/nativescript-camera/issues) strictly for [reporting bugs](CONTRIBUTING.md#reporting-bugs) or [requesting features](CONTRIBUTING.md#requesting-new-features). For general questions and support, check out the [NativeScript community forum](https://discourse.nativescript.org/) or ask our experts in [NativeScript community Slack channel](http://developer.telerik.com/wp-login.php?action=slack-invitation). | ||
![](https://ga-beacon.appspot.com/UA-111455-24/nativescript/nativescript-camera?pixel) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
47789
11
168
1