From 5f522c605df50836898f92d82a99be407b1751f4 Mon Sep 17 00:00:00 2001 From: Jamie Kyle <113370520+jamiebuilds-signal@users.noreply.github.com> Date: Mon, 24 Apr 2023 11:05:30 -0700 Subject: [PATCH] Always reencode images through canvas --- ts/util/scaleImageToLevel.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ts/util/scaleImageToLevel.ts b/ts/util/scaleImageToLevel.ts index 0b3105f3f..a0b632015 100644 --- a/ts/util/scaleImageToLevel.ts +++ b/ts/util/scaleImageToLevel.ts @@ -140,14 +140,8 @@ export async function scaleImageToLevel( MEDIA_QUALITY_LEVEL_DATA.get(level) || DEFAULT_LEVEL_DATA; if (fileOrBlobOrURL.size <= thresholdSize) { - let blob: Blob; - if (data.exif != null) { - blob = await canvasToBlob(data.image, contentType); - } else { - // If we don't have EXIF data, we can just return the original blob - // to avoid occasionally making the image larger. - blob = fileOrBlobOrURL; - } + // Always encode through canvas as a temporary fix for a library bug + const blob: Blob = await canvasToBlob(data.image, contentType); return { blob, contentType,