Skip to content

takePicture() with specified width/height not working #55

Closed
@DivyeshSharma

Description

@DivyeshSharma

We want to allow our user to take selfies in our app which we have build in Nativescript 3.1.2 (tns-core-modules 3.1.0, tns-android 3.1.1).

  1. Is there any nativescript plugin available that allows user to crop an image where user can select the area on a screen which he wants to crop? We tried searching but did not able find it.

  2. As an alternative we have tried nativescript-camera plugin (version 3.0.0) that has feature to automatically crop the image based on defined height and width as below:

     takePicture({ width: 300, height: 300, keepAspectRatio: false, saveToGallery: true }).
     then((imageAsset) => {
     	let image = new Image();
     	image.src = imageAsset;
     },
     (err) => {
     	console.log("Error -> " + err.message);
     });
    

But here we did not get image with specified height and width (in saved image in gallery OR in imageAsset object). It is always returning actual image.
I am little bit stuck over here and wondering why such a basic image manipulation functionality is not working in native script.

Please reply if anyone has any solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions