Fix preview to show actual capture aspect ratio

Changes:
1. Preview layer now uses .resizeAspect instead of .resizeAspectFill
   - Shows exactly what will be in the captured photo
   - No cropping - what you see is what you get
   - Ring light naturally fills any letterbox areas

2. Session preset changed from .high to .photo
   - Optimized for photo capture
   - Consistent 4:3 aspect ratio
   - Better quality for selfies

This ensures the preview accurately represents the final photo,
eliminating surprise cropping in captured images.
This commit is contained in:
Matt Bruce 2026-01-02 16:01:43 -06:00
parent 80976c61d1
commit e66487cabf
2 changed files with 5 additions and 2 deletions

View File

@ -128,7 +128,9 @@ class CameraPreviewUIView: UIView {
if let layer = self.layer as? AVCaptureVideoPreviewLayer {
layer.session = session
layer.videoGravity = .resizeAspectFill
// Use .resizeAspect to show exactly what will be captured
// The ring light fills any letterbox areas naturally
layer.videoGravity = .resizeAspect
previewLayer = layer
viewModel.previewLayer = layer

View File

@ -69,7 +69,8 @@ class CameraViewModel: NSObject {
guard let session = captureSession else { return }
session.beginConfiguration()
session.sessionPreset = .high
// Use .photo preset for optimal photo quality and consistent 4:3 aspect ratio
session.sessionPreset = .photo
let device = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: isUsingFrontCamera ? .front : .back)
guard let device, let input = try? AVCaptureDeviceInput(device: device) else { return }