Use photo preset to remove excess zoom on ios 17+ #368
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.
Summary:
Fixes issue where iOS 17 & 18, CameraPreview.start {
position: rear,
disableAudio: true,
enableHighResolution: false
}, with no use of any CameraPreview.setZoom, was showing a more zoomed in feed than the native Camera app did.
Task Links:
PR #339
Issue #180
Test Instructions:
Place iOS device on a stack of books overlooking a computer keyboard, to keep an identical device position.
Use the native Camera app to take a photo of the keyboard.
Create code that shows the prior photo with partial transparency over the fullscreen CameraPreview.start feed.
Verify that the preview feed matches the scale of the key outlines and lettering in the reference photo.
Developer Notes:
I tested my solution on an iPhone 12 Pro iOS18.3 (which has multiple rear cameras, devicePixelRatio of 3) and an iPad (no notch, only has one rear camera, devicePixelRatio 2) iOS 17, and the fix showed correctly on both.
Update: Verified this works on iPhone 11 iOS18 (the zoom amount was correct, for the placement: instead of modifying AVLayerVideoGravity.resizeAspectFill, it needed the below for its devicePixelRatio of 2)