From 9767ec5495dc8e20e9db78b1ace6bb47f98f79cb Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Mon, 6 Sep 2010 13:23:58 -0400 Subject: [PATCH] Use IPTC caption property if it's available. --- ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m index f68328623..f683a78ef 100644 --- a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m +++ b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m @@ -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], -- 2.11.0