Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Preserve recovery image aspect ratio

Neeraj Gupta641ad234b367
diff --git a/web/apps/legacy/src/features/legacy-kit/scan.ts b/web/apps/legacy/src/features/legacy-kit/scan.ts
index 6acc7e0466..301d595501 100644
--- a/web/apps/legacy/src/features/legacy-kit/scan.ts
+++ b/web/apps/legacy/src/features/legacy-kit/scan.ts
@@ -108,7 +108,9 @@ const imageBitmapOptions = (
dimensions: ImageDimensions,
): ImageBitmapOptions => {
const { height, width } = imageOutputDimensions(dimensions);
- return { resizeHeight: height, resizeQuality: "high", resizeWidth: width };
+ return dimensions.width >= dimensions.height
+ ? { resizeQuality: "high", resizeWidth: width }
+ : { resizeHeight: height, resizeQuality: "high" };
};
const byteAt = (bytes: Uint8Array, offset: number) => bytes[offset] ?? 0;