0

I am unable to find any recent example on how to read EXIF/IPTC information from an image in Cocoa. Is there anything that can be easily done or should I use an external tool as exiftool and start it with NSTask ?

Thanks !

Laurent Crivello
  • 3,809
  • 6
  • 45
  • 89

2 Answers2

5

There's some code that appears useful here: http://devmacosx.blogspot.com/2011/07/nsimage-exif-metadata.html

Caleb
  • 124,013
  • 19
  • 183
  • 272
3

You can use the Image Source functions from the Image IO library. Something like...

CGImageSourceCreateWithData(someCFDataRef, nil);
CFDictionaryRef dictRef = CGImageSourceCopyPropertiesAtIndex(imgSource, 0, nil);

should fill dictRef with the EXIF data.

Adam Wright
  • 48,938
  • 12
  • 131
  • 152