mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-25 09:32:46 +00:00
Don't alias incompatible photo resources
This commit is contained in:
parent
28e74dad30
commit
c74a2baa7a
@ -26,8 +26,11 @@ func applyMediaResourceChanges(from: Media, to: Media, postbox: Postbox, force:
|
||||
}
|
||||
}
|
||||
if let fromLargestRepresentation = largestImageRepresentation(fromImage.representations), let toLargestRepresentation = largestImageRepresentation(toImage.representations) {
|
||||
if fromLargestRepresentation.progressiveSizes != toLargestRepresentation.progressiveSizes {
|
||||
} else {
|
||||
copyOrMoveResourceData(from: fromLargestRepresentation.resource, to: toLargestRepresentation.resource, mediaBox: postbox.mediaBox)
|
||||
}
|
||||
}
|
||||
} else if let fromFile = from as? TelegramMediaFile, let toFile = to as? TelegramMediaFile {
|
||||
if let fromPreview = smallestImageRepresentation(fromFile.previewRepresentations), let toPreview = smallestImageRepresentation(toFile.previewRepresentations) {
|
||||
copyOrMoveResourceData(from: fromPreview.resource, to: toPreview.resource, mediaBox: postbox.mediaBox)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user