Use IPTC caption property if it's available.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 6 Sep 2010 17:23:58 +0000 (13:23 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 6 Sep 2010 17:23:58 +0000 (13:23 -0400)
ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m

index f683286..f683a78 100644 (file)
@@ -291,9 +291,19 @@ NSString * const TURAnselServerVersionKey = @"version";
 
     NSLog(@"Image Type: %@", fileType);
 
+    NSDictionary *IPTC = [properties objectForKey: kExportKeyIPTCProperties];
+    
+    // Use the IPTC Caption property, if available, otherwise use the version
+    // name.
+    NSString *caption;
+    if ([IPTC objectForKey:@"Caption/Abstract"]) {
+        caption = [IPTC objectForKey:@"Caption/Abstract"];
+    } else {
+        caption = [properties objectForKey:kExportKeyVersionName];
+    }
     NSArray *values = [[NSArray alloc] initWithObjects:
                        path,
-                       [properties objectForKey: kExportKeyVersionName],
+                       caption,
                        base64ImageData,
                        fileType,
                        [properties objectForKey:kExportKeyKeywords],