Friday, August 19, 2011

More on reading exif data

If you are displaying an image from the camera roll, it helps to read the orientation from the exif data. iOS stores the image in a standard way within the jpeg file and expects apps to read the orientation when displaying that image. Other media libraries orient the image in the file already and don't record orientation data. A third possibility exists, that the image encoder both orients the image and records orientation -- but I haven't checked that out yet. On my three Android devices, two didn't record an orientation. When I get a chance, I'm going to write something that will read the exif data and rotate the image appropriately.

Thursday, August 18, 2011

Reading exif data on iOS (Adobe AIR)

When an AIR application gets an image from the CameraUI or CameraRoll class on iOS, the device returns a file that obeys the JPEG JFIF standard rather than the JPEG Exif defacto standard. While these standards are very similar, they each make one incompatible requirement -- that their format marker tag go first! In practice, at least for iOS images from the media library, this just means that you have to expect that the JFIF marker might be there when you are looking for the exif data.

At least one popular ActionScript exif reading library, jp.shichiseki.exif doesn't expect the JFIF marker and fails to find the exif data. The fix is easy, though.