문제

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 !

도움이 되었습니까?

해결책

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top