1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2025-02-03 18:57:46 +01:00

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

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