From: Michael J. Rubinsky Date: Mon, 6 Sep 2010 17:23:58 +0000 (-0400) Subject: Use IPTC caption property if it's available. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9767ec5495dc8e20e9db78b1ace6bb47f98f79cb;p=horde.git Use IPTC caption property if it's available. --- 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],