From 2fb88cfba89e3360bd3607ccfdd5f01291e0fd35 Mon Sep 17 00:00:00 2001 From: Ryan Miller Date: Thu, 2 May 2024 14:35:02 +1000 Subject: [PATCH] fix: change max avatar size to match other platforms --- ts/util/attachmentsUtil.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ts/util/attachmentsUtil.ts b/ts/util/attachmentsUtil.ts index 913e96c9c..3e5703848 100644 --- a/ts/util/attachmentsUtil.ts +++ b/ts/util/attachmentsUtil.ts @@ -3,6 +3,7 @@ import imageType from 'image-type'; import { arrayBufferToBlob } from 'blob-util'; import loadImage from 'blueimp-load-image'; +import fileSize from 'filesize'; import { StagedAttachmentType } from '../components/conversation/composition/CompositionBox'; import { SignalService } from '../protobuf'; import { getDecryptedMediaUrl } from '../session/crypto/DecryptedAttachmentsManager'; @@ -53,7 +54,7 @@ export async function autoScaleForAvatar( } if (blob.type === IMAGE_GIF && blob.size > maxSize) { - throw new Error(`GIF is too large, required size is ${maxSize}`); + throw new Error(`GIF is too large. Max size: ${fileSize(maxSize, { base: 10, round: 0 })}`); } perfStart(`loadimage-*${blob.size}`);