From a45fa65802761f9bb43b993813fb2f4a8b771b09 Mon Sep 17 00:00:00 2001 From: CMK Date: Wed, 23 Nov 2022 12:27:46 +0800 Subject: [PATCH] chore: set minimal size limit for photo to 1MiB --- .../Attachment/AttachmentViewModel+Compress.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Attachment/AttachmentViewModel+Compress.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Attachment/AttachmentViewModel+Compress.swift index 6df22d324..417bc773a 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Attachment/AttachmentViewModel+Compress.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/Attachment/AttachmentViewModel+Compress.swift @@ -97,7 +97,7 @@ extension AttachmentViewModel { extension AttachmentViewModel { @AttachmentViewModelActor func compressImage(data: Data, sizeLimit: SizeLimit) throws -> Output { - let maxPayloadSizeInBytes = sizeLimit.image ?? 10 * 1024 * 1024 + let maxPayloadSizeInBytes = max((sizeLimit.image ?? 10 * 1024 * 1024), 1 * 1024 * 1024) guard let image = KFCrossPlatformImage(data: data)?.kf.normalized, var imageData = image.kf.pngRepresentation()