chore: set minimal size limit for photo to 1MiB

This commit is contained in:
CMK 2022-11-23 12:27:46 +08:00
parent f784df912d
commit a45fa65802
1 changed files with 1 additions and 1 deletions

View File

@ -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()