mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Implement progressive JPEG for photos
This commit is contained in:
@@ -69,6 +69,15 @@ public func imageRepresentationLargerThan(_ representations: [TelegramMediaImage
|
||||
}
|
||||
}
|
||||
|
||||
public func progressiveImageRepresentation(_ representations: [TelegramMediaImageRepresentation]) -> TelegramMediaImageRepresentation? {
|
||||
for representation in representations {
|
||||
if representation.progressiveSizes.count > 1 {
|
||||
return representation
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
public func parseMediaData(data: Data) -> Media? {
|
||||
let buffer = BufferReader(Buffer(data: data))
|
||||
var parseBuffer: Buffer?
|
||||
|
||||
Reference in New Issue
Block a user