forked from shadowfacts/Tusker
Fix blurhash image being used as gallery content
This commit is contained in:
parent
fe00015248
commit
eafb506d64
|
@ -30,7 +30,7 @@ class StatusAttachmentsGalleryDataSource: GalleryDataSource {
|
||||||
switch attachment.kind {
|
switch attachment.kind {
|
||||||
case .image:
|
case .image:
|
||||||
if let view = attachmentView(for: attachment),
|
if let view = attachmentView(for: attachment),
|
||||||
let image = view.image {
|
let image = view.attachmentImage {
|
||||||
return ImageGalleryContentViewController(
|
return ImageGalleryContentViewController(
|
||||||
url: attachment.url,
|
url: attachment.url,
|
||||||
caption: attachment.description,
|
caption: attachment.description,
|
||||||
|
|
|
@ -32,6 +32,16 @@ class AttachmentView: GIFImageView {
|
||||||
|
|
||||||
private var loadAttachmentTask: Task<Void, Never>?
|
private var loadAttachmentTask: Task<Void, Never>?
|
||||||
private var source: Source?
|
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? {
|
var originalData: Data? {
|
||||||
switch source {
|
switch source {
|
||||||
case .image(_, let data, _):
|
case .image(_, let data, _):
|
||||||
|
|
Loading…
Reference in New Issue