Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Missing bindings for CIImage instance, applyingOrientation(orientation) function
Example of the use: https://gist.github.com/ivanherreragl/95425393cd5acf74cc047e17f5b012a9
(found in VisionML WWDC 2017 swift sample)
Do you have a link to the apple documentation for it, or an objective-c version of the sample code? I can't find it in the documentation on apple's website. The closest I'm finding in objective-c is 'imageByApplyingOrientation:', but it shows the swift version as 'oriented(orientation).
I can't find the home page of the Apple Sample. Craig Dunn created the Trello card for the porting. May be he knows where to find if there is an ObjC version of the app.
Anyway, imageByApplyingOrientation should be correct. Take in consideration the kind of value it expects.
When I download the Swift sample and build in latest Xcode 9, it errors with
"applyingOrientation' has been renamed to 'oriented(forExifOrientation:)"
so I think that answers the question - it's been renamed since the sample was published.
The _correct_ Swift is
inputImage = ciImage.oriented(forExifOrientation: Int32(orientation.rawValue))
Not sure if this sample is the same as:
but if so, it's already ported!
It uses this approach, possibly to hack around this issue above:
InputImage = ciImage.CreateWithOrientation(uiImage.Orientation.ToCIImageOrientation());
FYI the sample is at https://developer.apple.com/sample-code/wwdc/2017/ImageClassificationwithVisionandCoreML.zip
`imageByApplyingOrientation:` is the same as `func oriented(forExifOrientation orientation: Int32) -> CIImage` .
Swift has yet to provide API (or even ABI) stability so it's a moving target.
Anyway this API is already bound and part of XI.
@Ivan please double-check comment #4.