It works fine on Android, and detecting faces from a camera stream works fine as well. It's something in the rotation/orientation that's off. May even be an upstream issue, but I can't block the 6.0.0 release because of this issue, so moved it here.
Hello Eddy, first of all thank you very much for your vast contribution to the Nativescript community, you're the best!
I've found a solution or workaround for this bug, I can't say if is the best implementation but maybe can help you or others users to get it work properly.
File index.ios.js, function getImage(), change this:
function getImage(options) {
var image = options.image instanceof image_source_1.ImageSource ? options.image.ios : options.image.imageSource.ios;
return FIRVisionImage.alloc().initWithImage(image);
}
by this:
function getImage(options) {
var image = options.image instanceof image_source_1.ImageSource ? options.image.ios : options.image.imageSource.ios;
let newImage = UIImage.alloc().initWithCGImageScaleOrientation(image.CGImage, 1, 0)
return FIRVisionImage.alloc().initWithImage(newImage);
}
Basically I'm creating a new UIImage from the original one and setting the orientation to .up, processing this new image it works like a charm!
Hey @Macarthurval, that makes a lot of sense actually! Thanks for the hint. I tested it and it works as expected 馃槂