Every call to complete() with images resizes each image and writes it to the app cache dir with a random UUID filename. The resized files are never deleted.
iOS — ios/HybridCactusImage.swift lines 42–48:
let cacheDir = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask)[0]
let fileName = "\(UUID().uuidString).jpg"
let outputURL = cacheDir.appendingPathComponent("cactus/images", isDirectory: true)
.appendingPathComponent(fileName)
try FileManager.default.createDirectory(at: outputURL.deletingLastPathComponent(), withIntermediateDirectories: true)
try jpegData.write(to: outputURL)
Android follows the same pattern in HybridCactusImage.kt.
For apps that do heavy vision usage the cache dir grows until the OS reaps it. Either clean up after inference or reuse a single temp path.
Every call to
complete()with images resizes each image and writes it to the app cache dir with a random UUID filename. The resized files are never deleted.iOS —
ios/HybridCactusImage.swiftlines 42–48:Android follows the same pattern in
HybridCactusImage.kt.For apps that do heavy vision usage the cache dir grows until the OS reaps it. Either clean up after inference or reuse a single temp path.