From da9c11bbdf7e734cfb49c9540667cacdc1e0c644 Mon Sep 17 00:00:00 2001 From: Pinar Olguc Date: Thu, 3 Oct 2024 10:53:26 +0300 Subject: [PATCH] Decrease the max crop size (#444) Co-authored-by: etoledom --- Sources/Gravatar/Network/Services/ImageUploadService.swift | 2 +- .../GravatarUI/ImageCropper/ImageCropperViewController.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Gravatar/Network/Services/ImageUploadService.swift b/Sources/Gravatar/Network/Services/ImageUploadService.swift index cd4a3d74..5c7c8e37 100644 --- a/Sources/Gravatar/Network/Services/ImageUploadService.swift +++ b/Sources/Gravatar/Network/Services/ImageUploadService.swift @@ -14,7 +14,7 @@ struct ImageUploadService: ImageUploader { @discardableResult func uploadImage(_ image: UIImage, accessToken: String, additionalHTTPHeaders: [HTTPHeaderField]?) async throws -> (data: Data, response: HTTPURLResponse) { - guard let data = image.jpegData(compressionQuality: 0.9) else { + guard let data = image.jpegData(compressionQuality: 0.8) else { throw ImageUploadError.cannotConvertImageIntoData } diff --git a/Sources/GravatarUI/ImageCropper/ImageCropperViewController.swift b/Sources/GravatarUI/ImageCropper/ImageCropperViewController.swift index f881e4cb..28276f0f 100644 --- a/Sources/GravatarUI/ImageCropper/ImageCropperViewController.swift +++ b/Sources/GravatarUI/ImageCropper/ImageCropperViewController.swift @@ -4,7 +4,7 @@ class ImageCropperViewController: UIViewController, UIScrollViewDelegate { private enum Constants { static let backgroundColor = UIColor.black static let croperFrameSize: CGFloat = 320 - static let maxOutputImageSizeInPixels: CGFloat = 2048 + static let maxOutputImageSizeInPixels: CGFloat = 1280 } // ScrollView for zooming and panning