Skip to content

Commit cf8662d

Browse files
Zdravko BranzovZdravko Branzov
Zdravko Branzov
authored and
Zdravko Branzov
committed
fix: saveToGallery to default to true on both platforms
1 parent 1d0f44c commit cf8662d

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ npm install nativescript-camera --save
4343
| 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). |
4444
| 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). |
4545
| keepAspectRatio | true | Defines if camera picture aspect ratio should be kept during picture resizing. This property could affect width or height return values. |
46-
| saveToGallery | false | Defines if camera picture should be copied to photo Gallery (Android) or Photos (iOS) |
46+
| saveToGallery | true | Defines if camera picture should be copied to photo Gallery (Android) or Photos (iOS) |
4747
| cameraFacing | rear | The initial camera facing. Use 'front' for selfies. |
4848

4949
## Usage

demo/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"typescript": "~2.2.2",
4747
"webpack": "~3.8.1",
4848
"webpack-bundle-analyzer": "^2.8.2",
49-
"webpack-sources": "~1.0.1"
49+
"webpack-sources": "~1.0.1",
50+
"uglifyjs-webpack-plugin": "~1.1.6"
5051
}
5152
}

src/camera.android.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export let takePicture = function (options?): Promise<any> {
2525
let types: typeof typesModule = require("tns-core-modules/utils/types");
2626
let utils: typeof utilsModule = require("tns-core-modules/utils/utils");
2727

28-
let saveToGallery;
28+
let saveToGallery = true;
2929
let reqWidth;
3030
let reqHeight;
3131
let shouldKeepAspectRatio;
@@ -77,6 +77,9 @@ export let takePicture = function (options?): Promise<any> {
7777
if (options && options.cameraFacing === "front") {
7878
takePictureIntent.putExtra("android.intent.extras.CAMERA_FACING",
7979
android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT);
80+
} else {
81+
takePictureIntent.putExtra("android.intent.extras.CAMERA_FACING",
82+
android.hardware.Camera.CameraInfo.CAMERA_FACING_BACK);
8083
}
8184

8285
if (takePictureIntent.resolveActivity(utils.ad.getApplicationContext().getPackageManager()) != null) {

src/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-camera",
3-
"version": "3.2.1",
3+
"version": "4.0.0",
44
"description": "Provides API for using device camera",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)