From 4548ca93e504c4e3de8a4559f7579df0e9592f71 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Wed, 2 Aug 2023 14:15:07 +0200 Subject: [PATCH] Add default options to capture high quality photos --- src/components/Camera/CameraContainer.js | 8 +++++--- src/components/Camera/CameraView.js | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/Camera/CameraContainer.js b/src/components/Camera/CameraContainer.js index 78c8fb0c9..857564962 100644 --- a/src/components/Camera/CameraContainer.js +++ b/src/components/Camera/CameraContainer.js @@ -68,9 +68,11 @@ const CameraContainer = ( ): Node => { const devices = useCameraDevices( ); const device = devices[cameraPosition]; const hasFlash = device?.hasFlash; - const initialPhotoOptions = hasFlash - ? { flash: "off" } - : { }; + const initialPhotoOptions = { + enableAutoStabilization: true, + qualityPrioritization: "quality", + ...( hasFlash && { flash: "off" } ) + }; const [takePhotoOptions, setTakePhotoOptions] = useState( initialPhotoOptions ); const { deviceOrientation } = useDeviceOrientation( ); const [showDiscardSheet, setShowDiscardSheet] = useState( false ); diff --git a/src/components/Camera/CameraView.js b/src/components/Camera/CameraView.js index 06cd1a7e4..aee8e6d7d 100644 --- a/src/components/Camera/CameraView.js +++ b/src/components/Camera/CameraView.js @@ -155,6 +155,8 @@ const CameraView = ( { : null} ref={cameraRef} device={device} + preset="photo" + enableHighQualityPhotos // Props for ARCamera only frameProcessor={frameProcessor} frameProcessorFps={frameProcessorFps}