Skip to content

Commit 7a928d7

Browse files
committed
Update Image Storing and Providing
1 parent 56f0f98 commit 7a928d7

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Sources/ScreenDataUI/Helpers/SDImage/SDImageProviding.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public struct SDImageFileProvider: SDImageProviding {
4646
Future { promise in
4747
let key = url.absoluteString.replacingOccurrences(of: "/", with: "-")
4848

49-
guard let data: Data = try? __.transput.file.in(filename: key) else {
49+
guard let data = try? __.transput.file.data(filename: key) else {
5050
log(level: .error("(SDImageFileProvider) Could not load Image for key (\(key)).", nil))
5151
promise(.success(nil))
5252
return

Sources/ScreenDataUI/Helpers/SDImage/SDImageStoring.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ public struct SDImageFileStore: SDImageStoring {
2222
let key = url.absoluteString.replacingOccurrences(of: "/", with: "-")
2323

2424
if let imageData = image?.pngData() {
25-
try? __.transput.file.out(imageData, filename: key)
25+
do {
26+
try __.transput.file.out(imageData, filename: key)
27+
} catch {
28+
log(level: .error("Error storing image for key (\(key))", error))
29+
}
2630
}
2731

2832
promise(.success(()))

0 commit comments

Comments
 (0)