File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,26 @@ context
7575
7676> **NOTE**: To request permissions for Android 6+ (API 23+) we use [nativescript-permissions](https://www.npmjs.com/package/nativescript-permissions).
7777
78+ ### Process the selection with scaling images to specified dimensions and returning ImageSource object
79+
80+ ```
81+ context
82+ .authorize()
83+ .then(function() {
84+ return context.present();
85+ })
86+ .then(function(selection) {
87+ selection.forEach((selectedPhoto) => {
88+ selectedPhoto.getImage({ maxWidth: 500, maxHeight: 500 }) // maintains aspect ratio
89+ .then((imageSource) => {
90+ // process the selected image
91+ });
92+ });
93+ }).catch(function (e) {
94+ // process error
95+ });
96+ ```
97+
7898## API
7999
80100### Methods
Original file line number Diff line number Diff line change @@ -357,7 +357,7 @@ class ImagePickerPH extends ImagePicker {
357357 PHImageManager . defaultManager ( ) . requestImageForAssetTargetSizeContentModeOptionsResultHandler (
358358 image ,
359359 size ,
360- PHImageContentMode . AspectFill ,
360+ PHImageContentMode . AspectFit , // Scales the image so that its larger dimension fits the target size
361361 resizeMode ,
362362 ( createdImage , data ) => {
363363 if ( createdImage ) {
You can’t perform that action at this time.
0 commit comments