Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lopoz

macrumors regular
Original poster
May 10, 2005
134
9
Hello,

I'm trying to extract specific creator data from the IPTC of an image, but not having a lot of luck..

I'm talking about the objects for the following keys:
kCGImagePropertyIPTCContactInfoAddress
kCGImagePropertyIPTCContactInfoCity
kCGImagePropertyIPTCProvinceState
kCGImagePropertyIPTCContactInfoPostalCode
etc. (basically the Creator Contact info from the IPTC)

This is my code:
Code:
CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef) url, NULL);
NSDictionary *metadata = (NSDictionary *)CGImageSourceCopyPropertiesAtIndex(source, 0, NULL);

[[metadata objectForKey:(id)kCGImagePropertyIPTCDictionary] objectForKey:(id)kCGImagePropertyIPTCContactInfoAddress]
etc..

Unfortunately, this doesn't seem to work. When compiling, I get this error message:
Code:
  "_kCGImagePropertyIPTCContactInfoAddress", referenced from:
-[AppController getMetadata:] in AppController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

All other EXIF and IPTC data is fine..

Any help?

Thanks in advance!
 
Okay, so I found out from the ImageIO header in the 10.6 SDK, that kCGImagePropertyIPTCDictionary contains kCGImagePropertyIPTCCreatorContactInfo and THAT contains these possible keys

Code:
CG_EXTERN const CFStringRef kCGImagePropertyIPTCContactInfoCity  __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_NA);
CG_EXTERN const CFStringRef kCGImagePropertyIPTCContactInfoCountry  __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_NA);
CG_EXTERN const CFStringRef kCGImagePropertyIPTCContactInfoAddress  __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_NA);
CG_EXTERN const CFStringRef kCGImagePropertyIPTCContactInfoPostalCode  __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_NA);
CG_EXTERN const CFStringRef kCGImagePropertyIPTCContactInfoStateProvince  __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_NA);
CG_EXTERN const CFStringRef kCGImagePropertyIPTCContactInfoEmails  __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_NA);
CG_EXTERN const CFStringRef kCGImagePropertyIPTCContactInfoPhones  __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_NA);
CG_EXTERN const CFStringRef kCGImagePropertyIPTCContactInfoWebURLs  __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_NA);

So now I'm trying to access them by calling e.g.:
Code:
[[[metadata objectForKey:(id)kCGImagePropertyIPTCDictionary] objectForKey:(id)kCGImagePropertyIPTCCreatorContactInfo] objectForKey:(id)kCGImagePropertyIPTCContactInfoCity]

But I'm presented with the same error.. And yes, I changed my base SDK to 10.6, since these keys are new in SL.

Any ideas?
 
Have you included the ImageIO framework in your project? I don't think it's included as standard which would explain the linker errors...
 
Have you included the ImageIO framework in your project? I don't think it's included as standard which would explain the linker errors...
Yes, I've linked the ApplicationServices.framework which includes the ImageIO framework (and imported the header file).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.