Skip to content

Camera.takePhoto method ignores the targetWidth and targetHeight options #70

Description

@ejohanson-vi3

Bug Report

Plugin(s)

@capacitor/camera 8.0.2

Capacitor Version

   Capacitor Doctor

Latest Dependencies:

  @capacitor/cli: 8.5.0
  @capacitor/core: 8.5.0
  @capacitor/android: 8.5.0
  @capacitor/ios: 8.5.0

Installed Dependencies:

  @capacitor/cli: 8.4.0
  @capacitor/core: 8.4.0
  @capacitor/ios: 8.4.0
  @capacitor/android: 8.4.0

[success] Android looking great!

Platform(s)

Android. Did not test on iOS.

Current Behavior

The new takePhoto method ignores the new targetWidth and targetHeight options.

Expected Behavior

The resulting image should have a resolution that matches the targetWidth and targetHeight specified in the Camera.takePhoto method.

Code Reproduction

const imageResult: MediaResult = await Camera.takePhoto({
		quality: 80,
		editable: "no",
		includeMetadata: true,
		cameraDirection: CameraDirection.Rear,
		correctOrientation: true,
		targetWidth: 1024,
		targetHeight: 768
	})
const fileResult: ReadFileResult = await Filesystem.readFile({ path: imageResult.uri })
/* examining the data in fileResult.data gives an image with a resolution of 3456x4608 */
/* rather than the requested resolution of 1024x768 */

Other Technical Details

Additional Context

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