chore: set minimal size limit for photo to 1MiB
This commit is contained in:
parent
f784df912d
commit
a45fa65802
|
@ -97,7 +97,7 @@ extension AttachmentViewModel {
|
||||||
extension AttachmentViewModel {
|
extension AttachmentViewModel {
|
||||||
@AttachmentViewModelActor
|
@AttachmentViewModelActor
|
||||||
func compressImage(data: Data, sizeLimit: SizeLimit) throws -> Output {
|
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,
|
guard let image = KFCrossPlatformImage(data: data)?.kf.normalized,
|
||||||
var imageData = image.kf.pngRepresentation()
|
var imageData = image.kf.pngRepresentation()
|
||||||
|
|
Loading…
Reference in New Issue