feat: Improvements about zoom scale value and ultra-wide camera#592
Merged
juliansteenbakker merged 6 commits intoApr 20, 2023
Merged
Conversation
Owner
|
Thanks! LGTM! |
|
hi, the title check is red. When this PR will be in a new version ? thank you |
2 tasks
joaopedro735
pushed a commit
to joaopedro735/mobile_scanner
that referenced
this pull request
Aug 22, 2024
…improvements feat: Improvements about zoom scale value and ultra-wide camera
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is for improvements zoom scale feature, especially for avoiding to select ultra wide camera unintentionally. Please review and merge if looks good.
New features
added
zoomScalevalue notifier in MobileScannerController for the application to know the zoom scale value set actually.The value is notified from the native SDK(CameraX/AVFoundation).
added
resetZoomScale()in MobileScannerController to reset zoom ratio with 1x.Both Android and iOS, if the device have ultra-wide camera, calling
setZoomScalewith small value causes to use ultra-wide camera and may be diffcult to detect barcodes.resetZoomScale()is useful to use standard camera with zoom 1x.setZoomScale()with the specific value can realize same effect, but addedresetZoomScalefor avoiding floating point errors.The application can know what zoom scale value is selected actually by subscribing
zoomScaleabove after callingresetZoomScale.Changed behaviors
(iOS only) call
resetZoomScalewhile starting scan.Android camera is initialized with a zoom of 1x, whereas iOS is initialized with the minimum zoom value, which causes to select the ultra-wide camera unintentionally ([iOS] Impossible to focus and scan the QR code due to picking the wide back camera #554).
Fixed this issue by calling
resetZoomScale(iOS only) remove zoom animation with
rampfunction to match Android behavior.