adorsys / YesWeScan

A library with a ready to use view controller for document scanning
Apache License 2.0
102 stars 33 forks source link

Camera zoomed in #38

Closed alexandremne closed 5 years ago

alexandremne commented 5 years ago

Why is camera zoomed in, once scanning controller is loaded?

xavierLowmiller commented 5 years ago

Hi @alexandremne,

I found some time today to look into this. TLDR: The image isn't zoomed, but the layers' aspect ratios are different.

Compare the images from the system camera and the scanner:

iPhone camera Scanner
camera scanner

You'll notice that the aspect ratio of the scanner is slightly taller, so more of the layer will be cropped off at the left and right edges. The image will be larger because of this.

There's nothing really we can do about this other than changing the UI so the layer has a similar aspect ratio as the camera. I think we're open to this option if you'd like to submit a pull request :+1:.

The resizing strategy is configured here if you're interested.

alexandremne commented 5 years ago

Oh, I get it. Ok, thank you for clarification. I will take a look and get back to you if I come up with a solution.

xavierLowmiller commented 5 years ago

:+1: That sounds nice. I'll close the issue, but feel free to reopen if you like.