switches URL to fileURLWithPath

This commit is contained in:
Stuart Breckenridge 2022-07-09 18:50:07 +01:00
parent db9dbc97ec
commit 424000975d
No known key found for this signature in database
GPG Key ID: 64DCE361D27B805B

View File

@ -55,7 +55,7 @@ struct ArticleItemView: View {
func thumbnail(from path: String?) -> Image? { func thumbnail(from path: String?) -> Image? {
guard let imagePath = path, guard let imagePath = path,
let url = URL(string: imagePath), let url = URL(fileURLWithPath: imagePath),
let data = try? Data(contentsOf: url), let data = try? Data(contentsOf: url),
let uiImage = UIImage(data: data) else { let uiImage = UIImage(data: data) else {
return Image(uiImage: UIImage(systemName: "globe")!) return Image(uiImage: UIImage(systemName: "globe")!)