Fix progressive photo sizes [nocache]

This commit is contained in:
Ali
2020-08-27 17:18:10 +01:00
parent 275e5c1a2e
commit fe440aad44

View File

@@ -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)