Skip to content

Commit

Permalink
fix: #598
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenceLove committed Mar 6, 2024
1 parent 51c1498 commit 3c2d977
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ extension EditorAdjusterView {
}
return
}
let compressionQuality = self.getCompressionQuality(CGFloat(imageData.count))
let compressionQuality = cropFactor.isRound ? nil : self.getCompressionQuality(CGFloat(imageData.count), imageSize: image.size)
self.compressImageData(
imageData,
compressionQuality: compressionQuality
Expand Down Expand Up @@ -372,7 +372,10 @@ extension EditorAdjusterView {
return image.merge(images: [overlayImage], scale: exportScale)
}

fileprivate func getCompressionQuality(_ dataCount: CGFloat) -> CGFloat? {
fileprivate func getCompressionQuality(_ dataCount: CGFloat, imageSize: CGSize) -> CGFloat? {
if imageSize.width * imageSize.height < 3840 * 3840 {
return nil
}
if dataCount > 30000000 {
return 25000000 / dataCount
}else if dataCount > 15000000 {
Expand Down Expand Up @@ -506,7 +509,7 @@ extension EditorAdjusterView {
&& waterCenterRatio == .zero

if isEmpty {
allowCroped = true
allowCroped = false
}else {
allowCroped = !(!isCropImage &&
!isRound &&
Expand Down

0 comments on commit 3c2d977

Please sign in to comment.