I am new to swift and I am trying the CoreML feature using React Native.
I have a source file with URL as string. I convert that string to URL using let imageURL = URL(fileURLWithPath: source)
and I tried printing out the source which is of type string and it contains the absolutePath to the file file:///var/mobile/Containers/Data/Application/9C4D58FD-C817-47CB-A418-04BA30863C24/Library/Caches/Camera/133F8168-356A-436C-B7AF-557FA1C4F68F.jpg"
After that, I try to make the CIImage
by using
let image = CIImage.init(contentsOf: imageURL);
But when I try to print image
, it returns nil
. I searched a bit and tried using guard
but no luck. Any help will be appreciated. Thanks in advance.