Skip to main content
Inspiring
July 12, 2011
Answered

CameraUI orientation

  • July 12, 2011
  • 7 replies
  • 2913 views

Is there a way to know the orientation of a picture taken with the CameraUI in AIR 2.7 (iOS or Android)? Air seems to assume that the picture is in landscape orientation but it's not always true. The information is in the EXIF data but loaders doesnt seems to give access to EXIF data.

It is a problem if you want to display the picture in your application... The orientation will be wrong...

I dont want to use an AS3 custom library because most of them will crash the app on IOS because they try to call forbidden methods...

So, any method in the API allow me to do this? Any workaround that doesnt imply an AS3 library?

This topic has been closed for replies.
Correct answer Joe ... Ward

The following information comes from one of Adobe's quality engineers. (Note that the ExifInfo library mentioned is the same as used in the flexnroses blog post example.)

>So I found that the image that we get after using CameraRoll/CameraUI  does contain EXIF information but not in the format expected by the  ExifInfo AS3 library (http://code.shichiseki.jp/as3/ExifInfo/).

Firstly, it does contain the orientation information which I am able to  verify using the Jpeg decoding tool :  http://www.impulseadventure.com/photo/jpeg-snoop-source.html.

The Exif data is stored in one of JPEG’s defined utility Application  Segments APPn. The AS3 library - ExifInfo that you are using for reading  Exif header expects APP1 marker whereas the actual image has APP0 at  that place followed by APP1 segment which contains the orientation data.  Images that comply to JFIF standards have APP0 marker just after SOI  (Start of Image) and images that comply to EXIF standards should have  APP1 marker after SOI.

As per wiki http://en.wikipedia.org/wiki/JPEG_File_Interchange_Format :  "many programs and digital cameras produce files with both application  segments included" which is what exactly happens in our case.

So I think you may try switching to a library which is able to parse an  image that has multiple APPn markers and read only the one required. You  can even modify the ExifInfo library.

Hope this helps.

7 replies

Participating Frequently
July 20, 2011

Like you i'm looking for a solution ~

One is working well http://blog.flexnroses.com/?p=95

But since MediaPromise problem with iOS it only works on Android.

Shame ~

Did you find something ?

RangoraAuthor
Inspiring
July 20, 2011

What is the mediapromise problem on iOS?

Joe ... WardCorrect answer
Participating Frequently
July 20, 2011

The following information comes from one of Adobe's quality engineers. (Note that the ExifInfo library mentioned is the same as used in the flexnroses blog post example.)

>So I found that the image that we get after using CameraRoll/CameraUI  does contain EXIF information but not in the format expected by the  ExifInfo AS3 library (http://code.shichiseki.jp/as3/ExifInfo/).

Firstly, it does contain the orientation information which I am able to  verify using the Jpeg decoding tool :  http://www.impulseadventure.com/photo/jpeg-snoop-source.html.

The Exif data is stored in one of JPEG’s defined utility Application  Segments APPn. The AS3 library - ExifInfo that you are using for reading  Exif header expects APP1 marker whereas the actual image has APP0 at  that place followed by APP1 segment which contains the orientation data.  Images that comply to JFIF standards have APP0 marker just after SOI  (Start of Image) and images that comply to EXIF standards should have  APP1 marker after SOI.

As per wiki http://en.wikipedia.org/wiki/JPEG_File_Interchange_Format :  "many programs and digital cameras produce files with both application  segments included" which is what exactly happens in our case.

So I think you may try switching to a library which is able to parse an  image that has multiple APPn markers and read only the one required. You  can even modify the ExifInfo library.

Hope this helps.

Participating Frequently
July 13, 2011

Hi,

This is currently not possible without the use of an external library. Which ones have you tried?

Thanks,

Sanika

RangoraAuthor
Inspiring
July 13, 2011

I didnt try a library for EXIF because I must implement some more important features first. If I get enough time to try libraries and find one that work on iOS, I will give you a feedback.