[APP-2044] Gate image blob size increase (#10178)

This commit is contained in:
Eric Bailey
2026-04-09 14:06:25 -05:00
committed by GitHub
parent c42940b0ad
commit cfeac097e1
4 changed files with 9 additions and 1 deletions
+3 -1
View File
@@ -204,6 +204,7 @@ export async function compressImage(
img: ComposerImage,
options?: {
highResolution?: boolean
increasedBlobSizeLimit?: boolean
},
): Promise<PickerImage> {
const source = img.transformed || img.source
@@ -211,6 +212,7 @@ export async function compressImage(
let attempts = 0
let maxDimension = highResolution ? 4000 : POST_IMG_MAX.width
let maxBytes = options?.increasedBlobSizeLimit ? 2000000 : POST_IMG_MAX.size
let minQualityPercentage = 0
let maxQualityPercentage = 101 // exclusive
@@ -251,7 +253,7 @@ export async function compressImage(
const base64 = res.base64
const size = base64 ? getDataUriSize(base64) : 0
if (base64 && size <= POST_IMG_MAX.size) {
if (base64 && size <= maxBytes) {
minQualityPercentage = qualityPercentage
newDataUri = {
path: await moveIfNecessary(res.uri),