mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Version 10.13
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import SGSimpleSettings
|
||||
import Foundation
|
||||
import UIKit
|
||||
import Photos
|
||||
@@ -121,7 +122,8 @@ public func fetchPhotoLibraryResource(localIdentifier: String, width: Int32?, he
|
||||
if let width, let height {
|
||||
size = CGSize(width: CGFloat(width), height: CGFloat(height))
|
||||
} else {
|
||||
size = CGSize(width: 1280.0, height: 1280.0)
|
||||
// MARK: Swiftgram
|
||||
size = SGSimpleSettings.shared.sendLargePhotos ? CGSize(width: 2560.0, height: 2560.0) : CGSize(width: 1280.0, height: 1280.0)
|
||||
}
|
||||
|
||||
var targetSize = PHImageManagerMaximumSize
|
||||
@@ -178,7 +180,7 @@ public func fetchPhotoLibraryResource(localIdentifier: String, width: Int32?, he
|
||||
defer {
|
||||
TempBox.shared.dispose(tempFile)
|
||||
}
|
||||
if let scaledImage = scaledImage, let data = compressImageToJPEG(scaledImage, quality: 0.6, tempFilePath: tempFile.path) {
|
||||
if let scaledImage = scaledImage, let data = compressImageToJPEG(scaledImage, quality: Float(SGSimpleSettings.shared.outgoingPhotoQuality) / 100.0, tempFilePath: tempFile.path) {
|
||||
#if DEBUG
|
||||
print("compression completion \((CACurrentMediaTime() - startTime) * 1000.0) ms")
|
||||
#endif
|
||||
@@ -188,7 +190,7 @@ public func fetchPhotoLibraryResource(localIdentifier: String, width: Int32?, he
|
||||
subscriber.putCompletion()
|
||||
}
|
||||
case .jxl:
|
||||
if let scaledImage = scaledImage, let data = compressImageToJPEGXL(scaledImage, quality: Int(quality ?? 75)) {
|
||||
if let scaledImage = scaledImage, let data = compressImageToJPEGXL(scaledImage, quality: Int(SGSimpleSettings.shared.outgoingPhotoQuality)) {
|
||||
#if DEBUG
|
||||
print("jpegxl compression completion \((CACurrentMediaTime() - startTime) * 1000.0) ms")
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user