Skip to content

bug: PWA Camera plugin cameraOptions ignored #102

@LuisPerez94

Description

@LuisPerez94

Bug Report

Capacitor Version

npx cap doctor output:
Capacitor Doctor

Latest Dependencies:

@capacitor/cli: 2.0.0

@capacitor/core: 2.0.0

@capacitor/android: 2.0.0

@capacitor/electron: 2.0.0

@capacitor/ios: 2.0.0

Installed Dependencies:

@capacitor/ios not installed

@capacitor/electron not installed

@capacitor/cli 2.0.0

@capacitor/core 2.0.0

@capacitor/android 2.0.0

[success] Android looking great! �👌

Affected Platform(s)

  • Web

Current Behavior

it seems when I use the getPhoto API with it's options quality, width and height those get ignored by the android camera. I recieve a big size image and the dimensions are not what I used regarding I expect a small image.

I was testing with my laptop camera and it was work Ok ( iI think is beacause is a VGA), and when I started to test on my phone (a huawei mate 10) I realized.

Expected Behaivor

It would be great that the camera method returns a image with the correct properties predifined.

I need this to get an image with at least 500kb size.

Sample Code or Sample Application Repo

image = await Camera.getPhoto({
      quality: 10,
      height: 1280,
      width: 960,
      allowEditing: false,
      saveToGallery: true,
      direction: CameraDirection.Rear,
      source: CameraSource.Camera,
      resultType: CameraResultType.DataUrl
    });

but when I want to upload mi image to internet its weight is to big

image

Reproduction Steps

Other Technical Details

npm --version output: 6.13.4

node --version output:v 12.14.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions