capacitor-community / capacitor-community/camera-preview

Change resizeAspectFill to a configuration property

Open
#180 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
227
Forks
185
PR merge metrics
No merged PRs in 30d

Description

CameraController file function displayPreview

There is a line

`self.previewLayer?.videoGravity = AVLayerVideoGravity.resizeAspectFill`

This looks good, but it means that the viewfinder doesn't accurately represent the picture being taken. There is more to the left and right of the image than the viewfinder shows.

For my project, I needed to change it to

`self.previewLayer?.videoGravity = AVLayerVideoGravity.resizeAspect`

This fixes my issue, but it would be good if this was a property.
This may also help with some of the zoom issues people are having.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.