Skip to main content
Participating Frequently
Mar 14, 2013 5:32 PM UTC
Answered

CameraRoll & CameraUI image orientation

Hi,

I am trying to read the Orientation tag in EXIF image data grabbed with CameraRoll or CameraRollUI using AIR 3.6 on iOS 6.1

To achieve this, I use this library coded by Christian Cantrell :

http://blogs.adobe.com/cantrell/archives/2011/10/parsing-exif-data-from-images-on-mobile-devices.html

Unfortunantly, it raises an error when I try to parse the Byterray containing the EXIF data :

var exifInfo:ExifInfo = new ExifInfo( eb );


TypeError: Error #1034: Type Coercion failed: cannot convert "<tags level="0th IFD TIFF Tags">

  <tag tag_name="Image width" field_name="ImageWidth" id="0x0100" compressed="J">

    <uncompressed chunky="M" planar="M" ycc="M" />

  ... INSERT BIG CHUNK OF XML HERE ...

</tags>" to XML.

          at jp.shichiseki.exif::ExifInfo/readIFDs()[/Users/***/Google Drive/AS3/libs/jp/shichiseki/exif/ExifInfo.as:100]

          at jp.shichiseki.exif::ExifInfo()[/Users/***/Google Drive/AS3/libs/jp/shichiseki/exif/ExifInfo.as:63]

It seems that Air can't cast the data into XML, but it's kind of crazy because I am able to see all the data in the error text (I purposedly truncated it here for not flooding this post) and it's XML valid. I had a look into the ExifInfo class, but it's hard to see where the error comes from.

I really need to get access to these data, since it's the only way to determine image orientation in iOS. Or is there any native extention thaht I could use to achieve this ?

Any advice will be welcome as I am stuck on a project for a client because of this.

Thank you all !

This topic is closed to new replies. Start a new post to keep the conversation going.
Colin Holgate
Colin HolgateCorrect answer
Inspiring
Mar 14, 2013 6:22 PM UTC

Essentially I gave up. For most cases the user would be taking a new picture, and that wasn't a problem. The problem case was that they would load an old picture that had been taken the opposite orientation of the app. The tool had easy ways to rotate the image, so I didn't worry so much about the problem.

14 replies

Known Participant
Oct 20, 2015 12:39 PM UTC

It's still a bug. Here's the bug reported in bugbase. Bug#4070057 - CameraRoll on iOS returns Bitmap in incorrect orientation

Translate
Participant
Feb 22, 2014 8:45 PM UTC

Hi

This is all really useful, except- the shichiseki library download doesn't seem to be available anymore. lt's returning 403 forbidden. Is it just me? Can anyone help with that?

Thank you

Translate
Colin Holgate
Inspiring
Feb 22, 2014 8:51 PM UTC

Can you take this example project? Use the Download Zip button over in the lower right of the page:

https://github.com/cantrell/ExifExample

Translate
Participant
Feb 23, 2014 7:59 AM UTC

Colin that's great thanks, I now have access to the library and the example Flash Builder project.  All I have to do now is get it all working with my code!

Translate
Colin Holgate
Inspiring
Mar 14, 2013 5:44 PM UTC

I looked at that for a while, and although I didn't get errors, I also didn't get orientation information on iOS. I didn't try Android, because I was doing this just for iOS at the time.

Translate
Participating Frequently
Mar 14, 2013 5:50 PM UTC

Well I am a  bit luckier on this since I am able to see the data in the console panel in FB, but embeded in the error :

<tag tag_name="Orientation of image" field_name="Orientation" id="0x0112" compressed="R">

    <uncompressed chunky="R" planar="R" ycc="R" />

</tag>

Did you succed with an other method or did you gave up ?

Translate
Colin Holgate
Colin HolgateCorrect answer
Inspiring
Mar 14, 2013 6:22 PM UTC

Essentially I gave up. For most cases the user would be taking a new picture, and that wasn't a problem. The problem case was that they would load an old picture that had been taken the opposite orientation of the app. The tool had easy ways to rotate the image, so I didn't worry so much about the problem.

Translate