kCGImagePropertyIPTCCaptionAbstract returns the wrong information

Originator:mark.hunte
Number:rdar://14810318 Date Originated:22 Aug 2013
Status:Open Resolved:
Product:OS X SDK Product Version:
Classification:Bug Reproducible:Always
 
Summary:The value returned by kCGImagePropertyIPTCCaptionAbstract from an image will return the value for the  IPTC key "Image Description"  if the key exists in the same file. 

Steps to Reproduce: Running this code on a image file with both keys:
 NSURL *imageFileURL = [NSURL fileURLWithPath:@"Path/to/file/nat_record_tasting_menu_004.jpg"];
    CGImageSourceRef imageSource = CGImageSourceCreateWithURL((CFURLRef)imageFileURL, NULL);
    NSDictionary *treeDict;
 NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
                             [NSNumber numberWithBool:NO], (NSString *)kCGImageSourceShouldCache,
                             nil];
    
    
    CFDictionaryRef imageProperties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, ( CFDictionaryRef)options);
    CFRelease(imageSource);
    if (imageProperties) {
        treeDict = [NSDictionary dictionaryWithDictionary:(NSDictionary*)(imageProperties)];
        id iptcTree = [treeDict objectForKey:@"{IPTC}"];
        
        for (NSString *key in [[iptcTree allKeys] sortedArrayUsingSelector:@selector(compare:)])
        {
           
            
            if ( [key isEqualToString: (NSString*) kCGImagePropertyIPTCCaptionAbstract]) {
                 
          
            id  value = [iptcTree  valueForKey:(NSString*) kCGImagePropertyIPTCCaptionAbstract]  ;
              
                 NSLog(@" kCGImagePropertyIPTCCaptionAbstract =  %@", value);

}
}
}

Expected Results:The returned caption should be from the "Caption/Abstract".

I.e. "Caption: Diners pose for pictures during a Guinness World Record attempt today to curate the world's longest tasting menu with 193 courses to be eaten over 24 hours."

Actual Results: The caption retuned is from the "Image Description" .

i.e "Caption: TV presenter  leaves St Albans Crown Court after being found guilty of harassment, causing her fear of violence, of former girlfriend during their relationship.  she was subjected to verbal, physical and emotional abuse between January and August last year. St Albans, London."

Regression:

Notes: I have used exifTool  on the command line (http://www.sno.phy.queensu.ca/~phil/exiftool/) on the same images which returns the correct info.

command line:

exiftool -Caption-Abstract  nat_record_tasting_menu_004.jpg

Other applications also return the correct values for the Caption-Abstract. for example MediaPro.

I have included a txt file with the full exifTool report which show all the keys and values in the file.
Also the image I am using as an example.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!