Create folders for images

This commit is contained in:
Christoph Hagen 2023-01-17 15:09:03 +01:00
parent 026336f24d
commit f3ee7a4fb4

View File

@ -181,6 +181,9 @@ final class ClassifierCreator {
} }
private func loadImage(cap: Int, image: Int) async -> Bool { private func loadImage(cap: Int, image: Int) async -> Bool {
guard createFolderIfMissing(imageDirectory.appendingPathComponent(String(format: "%04d", cap))) else {
return false
}
let url = imageUrl(base: server.appendingPathComponent("images"), cap: cap, image: image) let url = imageUrl(base: server.appendingPathComponent("images"), cap: cap, image: image)
let tempFile: URL, response: URLResponse let tempFile: URL, response: URLResponse
do { do {