mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-28 14:59:44 +00:00
Fix progressive photo sizes [nocache]
This commit is contained in:
@@ -32,9 +32,9 @@ public func largestRepresentationForPhoto(_ photo: TelegramMediaImage) -> Telegr
|
||||
|
||||
private let progressiveRangeMap: [(Int, [Int])] = [
|
||||
(100, [0]),
|
||||
(400, [2]),
|
||||
(600, [4, 5]),
|
||||
(Int(Int32.max), [4, 5, 8, 9])
|
||||
(400, [1]),
|
||||
(600, [2, 3]),
|
||||
(Int(Int32.max), [2, 3, 4])
|
||||
]
|
||||
|
||||
public func representationFetchRangeForDisplayAtSize(representation: TelegramMediaImageRepresentation, dimension: Int) -> Range<Int>? {
|
||||
@@ -52,7 +52,7 @@ public func representationFetchRangeForDisplayAtSize(representation: TelegramMed
|
||||
}
|
||||
|
||||
public func chatMessagePhotoDatas(postbox: Postbox, photoReference: ImageMediaReference, fullRepresentationSize: CGSize = CGSize(width: 1280.0, height: 1280.0), autoFetchFullSize: Bool = false, tryAdditionalRepresentations: Bool = false, synchronousLoad: Bool = false, useMiniThumbnailIfAvailable: Bool = false) -> Signal<Tuple4<Data?, Data?, ChatMessagePhotoQuality, Bool>, NoError> {
|
||||
if let progressiveRepresentation = progressiveImageRepresentation(photoReference.media.representations), progressiveRepresentation.progressiveSizes.count == 10 {
|
||||
if let progressiveRepresentation = progressiveImageRepresentation(photoReference.media.representations), progressiveRepresentation.progressiveSizes.count == 5 {
|
||||
enum SizeSource {
|
||||
case miniThumbnail(data: Data)
|
||||
case image(size: Int)
|
||||
|
||||
Reference in New Issue
Block a user