Fix blurhash image being used as gallery content

This commit is contained in:
Shadowfacts 2024-03-29 22:18:24 -04:00
parent fe00015248
commit eafb506d64
2 changed files with 11 additions and 1 deletions

View File

@ -30,7 +30,7 @@ class StatusAttachmentsGalleryDataSource: GalleryDataSource {
switch attachment.kind {
case .image:
if let view = attachmentView(for: attachment),
let image = view.image {
let image = view.attachmentImage {
return ImageGalleryContentViewController(
url: attachment.url,
caption: attachment.description,

View File

@ -32,6 +32,16 @@ class AttachmentView: GIFImageView {
private var loadAttachmentTask: Task<Void, Never>?
private var source: Source?
var attachmentImage: UIImage? {
switch source {
case .image(_, _, let image):
return image
case .gifData(_, _, let image):
return image
case nil:
return nil
}
}
var originalData: Data? {
switch source {
case .image(_, let data, _):