Skip to content

Commit

Permalink
Attempt to get keyword setting working
Browse files Browse the repository at this point in the history
  • Loading branch information
schwa committed Aug 21, 2011
1 parent 10e7d04 commit 40dfc4e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
31 changes: 28 additions & 3 deletions ApertureDuplicateFinder/ApertureLibraryProcessor.m
Expand Up @@ -306,9 +306,34 @@ - (BOOL)searchForDuplicates:(NSError **)outError
ApertureImageVersion *theVersion = [theApplication.imageVersions objectWithID:theImage.originalVersionUUID];
theVersion = [theVersion get];
NSLog(@"%@ -> %@", theImage.UUID, theVersion.name);




NSLog(@"%@", [theVersion.keywords valueForKey:@"name"]);

NSDictionary *theProperties = [NSDictionary dictionaryWithObjectsAndKeys:
@"x-duplicate", @"name",
NULL];
ApertureKeyword *theKeyword = [[[theApplication classForScriptingClass:@"keyword"] alloc] initWithProperties:theProperties];
// [theVersion.keywords get];
[theVersion.keywords addObject:theKeyword];

NSLog(@"%@", [theVersion.keywords valueForKey:@"name"]);

// NSLog(@"%@", [theKeyword lastError]);
// NSLog(@"%@", [theVersion lastError]);
//
// NSLog(@"%@", [theVersion.keywords get]);
//
// theProperties = [NSDictionary dictionaryWithObjectsAndKeys:
// @"MD5", @"name",
// @"something", @"value",
// NULL];
//
//// ApertureCustomTag *theTag = [[[theApplication classForScriptingClass:@"custom tag"] alloc] initWithProperties:theProperties];
//// [theVersion.customTags addObject:theTag];
//
// NSLog(@"%@", [theVersion.customTags get]);


}

// NSLog(@"%@", obj);
Expand Down
6 changes: 5 additions & 1 deletion README.markdown
Expand Up @@ -36,7 +36,7 @@ The file finds all master images by reading the private and not-to-be-accessed-b

It then enumerates over each image file, loading it into memory into a known image format (8-bit RGBA) and produces a MD5 hash for the pixel data. The hashes are then used to find duplicate images.

Each image that is a duplicate is then tagged as such.
Each image that is a duplicate is then tagged as such with the keyword "x-duplicate" (currently broken).

## Performance

Expand All @@ -45,3 +45,7 @@ Much of the code has been made multiprocessor happy with the use of GCD. While r
## Testing

Don't run this on your full Aperture library. That's nuts. Find an album or project that you know contains duplicates and then export that into a new library.

## Bugs

Setting the keyword seems to work, but the keyword is not visible inside Aperture itself. What the hell?

0 comments on commit 40dfc4e

Please sign in to comment.