From 1e1031f70acb19be854a113ddf5a2c20bd7ac8ac Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Sat, 20 Feb 2021 17:44:45 +0100 Subject: [PATCH] remove RESOLUTION_LIMIT --- example/src/Constants.ts | 7 ------- example/src/FormatFilter.ts | 18 ++---------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/example/src/Constants.ts b/example/src/Constants.ts index bb073b0..ed3e395 100644 --- a/example/src/Constants.ts +++ b/example/src/Constants.ts @@ -18,13 +18,6 @@ export const SAFE_AREA_PADDING = { // whether to use takeSnapshot() instead of takePhoto() on Android export const USE_SNAPSHOT_ON_ANDROID = false; -// The maximum photo resolution (in pixels). -// Setting this to a lower value means faster capture speed -// Setting this to a higher value means higher quality images -export const RESOLUTION_LIMIT = Platform.select({ - android: 3264 * 1840, -}); - // whether to use ultra-wide-angle cameras if available, or explicitly disable them. I think ultra-wide-angle cams don't support 60FPS... export const USE_ULTRAWIDE_IF_AVAILABLE = true; diff --git a/example/src/FormatFilter.ts b/example/src/FormatFilter.ts index 1a4ab1c..53c0efd 100644 --- a/example/src/FormatFilter.ts +++ b/example/src/FormatFilter.ts @@ -103,24 +103,10 @@ export const compareFormats = (left: CameraDeviceFormat, right: CameraDeviceForm const rightPhotoPixels = right.photoHeight * right.photoWidth; if (leftPhotoPixels > rightPhotoPixels) { // left has greater photo dimensions - const isLeftAbovePixelLimit = RESOLUTION_LIMIT != null && leftPhotoPixels > RESOLUTION_LIMIT; - if (isLeftAbovePixelLimit) { - // left exceeds our pixel limit - leftPoints -= 3; - } else { - // left does not exceed our pixel limit - leftPoints += 3; - } + leftPoints += 3; } else if (leftPhotoPixels < rightPhotoPixels) { // left has smaller photo dimensions - const isRightAbovePixelLimit = RESOLUTION_LIMIT != null && rightPhotoPixels > RESOLUTION_LIMIT; - if (isRightAbovePixelLimit) { - // right exceeds our pixel limit - leftPoints += 3; - } else { - // right does not exceed our pixel limit - leftPoints -= 3; - } + leftPoints -= 3; } const leftCropped = applyScaledMask(