Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone ImageIO not returning all metadata of picture

I am currently trying to make a simple library for accessing picture metadata in an object oriented way (no more dictionaries). I encountered a lot of strange bugs :

  1. Even if kCGImagePropertyMakerMinoltaDictionary, kCGImagePropertyMakerFujiDictionary, kCGImagePropertyMakerOlympusDictionary, kCGImagePropertyMakerPentaxDictionary keys are defined, I get an error when compiling my project saying they are undefined :

    Undefined symbols for architecture armv7: "_kCGImagePropertyMakerMinoltaDictionary", referenced from: -[SYMetadata metadataMakerMinolta] in SYMetadata.o ld: symbol(s) not found for architecture armv7

  2. kCGImagePropertyExifBodySerialNumber is a defined key too from ImageIO/CGImageProperties.h but when loading the project in iOS 5.1.1 I get an error saying it is not available :

    dyld: Symbol not found: _kCGImagePropertyExifBodySerialNumber Referenced from: /var/mobile/Applications/0D8144E6-6313-4347-B503-247F5ACC0A11/ConnectTIG.app/ConnectTIG Expected in: /System/Library/Frameworks/ImageIO.framework/ImageIO in /var/mobile/Applications/0D8144E6-6313-4347-B503-247F5ACC0A11/ConnectTIG.app/ConnectTIG

  3. Apple has a lot of possibles metadata dictionary keys available, for instance kCGImagePropertyMakerNikonDictionary, that exist but are not working. For example I have a picture taken with my Nikon D3100 : when I open it with Preview app on my mac I can access Nikon metadata, but when I get all keys and values on the iPhone I don't have these information.

I am running XCode 4.5.2 (last stable build AFAIK) on Moutain Lion 10.8.2. I tried compiling/running on device and simulator, same results.

As this will be a public library I already have it all on my github repo : https://github.com/dvkch/SYPictureMetadata

Those willing to discover where those bugs come from are welcomed to play around with the code and submit push requests any time.

If you have any possible idea it will be very appreciated !

Stan

like image 921
dvkch Avatar asked Nov 12 '22 15:11

dvkch


1 Answers

I'm fairly sure there is something wrong with the SDK. The error you're getting is a symbol that is defined in the SDK but doesn't actually exist. I've checked your project and you have included the ImageIO.framework where they're all defined, and indeed all the other keys work fine. kCGImagePropertyMakerNikonCameraSerialNumber works but kCGImagePropertyMakerMinoltaDictionary does not.

If you have a look at the top of the documentation for CGImageProperties it says the framework is "ApplicationServices/ImageIO". This is impossible, ApplicationServices doesn't exist on iOS. At least one error in this documentation already. Clearly they've copied the OSX documentation verbatim.

I'd definitely file a bug report on this problem and the documentation.

FWIW on OSX those keys (likely the same on iOS) are as follows:

{MakerCanon}
{MakerNikon}
{MakerMinolta}
{MakerFuji}
{MakerOlympus}
{MakerPentax}
like image 118
v01d Avatar answered Dec 16 '22 00:12

v01d