remove RESOLUTION_LIMIT

This commit is contained in:
Marc Rousavy 2021-02-20 17:44:45 +01:00
parent c1f3ea98d7
commit 1e1031f70a
2 changed files with 2 additions and 23 deletions

View File

@ -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;

View File

@ -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(