Bug 58542 - Missing bindings for CIImage instance, applyingOrientation(orientation) function
Summary: Missing bindings for CIImage instance, applyingOrientation(orientation) function
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 10.99 (xcode9)
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-08-02 10:01 UTC by Ivan Herrera
Modified: 2017-08-03 14:08 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED ANSWERED

Description Ivan Herrera 2017-08-02 10:01:08 UTC
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)
Comment 1 Timothy Risi 2017-08-02 18:11:42 UTC
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).
Comment 2 Ivan Herrera 2017-08-03 03:09:59 UTC
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.
Comment 3 CraigD 2017-08-03 03:27:01 UTC
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:
https://github.com/xamarin/private-samples/blob/master/ios11/CoreMLVision/
but if so, it's already ported!

It uses this approach, possibly to hack around this issue above:

```
InputImage = ciImage.CreateWithOrientation(uiImage.Orientation.ToCIImageOrientation());
```
Comment 5 Sebastien Pouliot 2017-08-03 14:08:49 UTC
`imageByApplyingOrientation:` is the same as `func oriented(forExifOrientation orientation: Int32) -> CIImage` [1].

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.

[1] https://developer.apple.com/documentation/coreimage/ciimage/1438223-imagebyapplyingorientation?language=objc