How to load an image from the filesystem?

Hello,


i am new to SwiftUI on macos and running into a problem.


I would like to load an external image to my view. Image() itself only loads images within the bundle.


Which function should i use to load an image from a file:///Volumes/... URL?


I tried


Image(nsImage: NSImage(named: self.flickrImageName)!)

.frame(width: 500, height: 200)

.background(Color.green)


with flickrimageName = "file:///Volumes/...image.jpg"

It compiles, but crashes on execution.



2020-01-02 12:08:45.747535+0100 MKFlickrRead[4462:130911] Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Users/kochma/Documents/Sources/Swift/MKFlickrRead/MKFlickrRead/ContentView.swift, line 19


Where do i go wrong