Skip to content

Commit

Permalink
rollback to sync load image (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
Doraemoe authored Jun 1, 2024
1 parent 725990e commit 5e1e3fa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions LANreader/Page/PageImageV2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,14 @@ struct PageImageV2: View {
return store.path
}
}()
AsyncImage(url: contentPath) { image in
image
// if use UIImage(contentsOfFile:) directly, IOSurface creation failed warning may happen
// Same thing happens in ImageService
if let imageData = try? Data(contentsOf: contentPath!), let uiImage = UIImage(data: imageData) {
Image(uiImage: uiImage)
.resizable()
.aspectRatio(contentMode: .fit)
.draggableAndZoomable(contentSize: geometrySize)
} placeholder: {
} else {
Image(systemName: "rectangle.slash")
.frame(height: geometrySize.height)
}
Expand Down

0 comments on commit 5e1e3fa

Please sign in to comment.