iPhoto Faces to Aperture

iPhoto Faces to Aperture

When iPhoto 9 added facial recognition features, some people complained about this feature not being in Aperture. I'd be surprised if this doesn't make it into Aperture 3 whenever that comes out, but for now here's a workaround, using the hidden 'fingerprint' stored in Aperture's Preview files.

  1. In Aperture 2.1 or above, generate Previews of the images you want to ID. The Preview preferences must be set to share Previews with iLife etc.
  2. In iPhoto 9, go to File>Show Aperture Library... and bring in the newly generated Previews. To save space, make sure iPhoto is NOT set to copy images on import.
  3. Run the Face recognition stuff.
  4. In iPhoto, go to the Faces section, open up one of the named albums and select all the photos of that person.
  5. Run this script. You will be prompted to enter the person's name. Using some magic (a technical term for a bright idea by Sal Soghoian), the script will look at each Preview and add a keyword in Aperture to the Version it is based on.
  6. Go to the next person's album in iPhoto and repeat steps 4 & 5.

Notes:

  • You can run this script multiple times without duplicating keywords - if the image already has that keyword applied, nothing extra will happen.
  • Not tested on Snow Leopard (yet), but it should be fine unless Spotlight terminal commands have changed.
  • The fancy version of this script would dig into iPhoto's Faces database and automatically grab the images that were tagged with each name, but that's not going to happen just yet. It might get aded to Aperture Assistant at some stage...

Ian

AttachmentSizeHitsLast download
iPhoto Faces to Aperture v1.scpt18.05 KB11712 min 23 sec ago

Doesn't work in Snow Leopard

Unfortunately, Snow Leopard doesn't seem to to add IPTC data to its database for images contained in a package such as the Aperture library. The information is still within the previews as can be confirmed when opening them with Preview.app.

Running mdls on a files within the Aperture library will not yield any IPTC data. Copying the preview from the library to the desktop and then run mdls on that file, will yield IPTC data and thus the Instruction tag, with the Aperture fingerprint.

As for now, I've modified your script to use Exiftools to extract the IPTC field, then It'll work in Snow Leopard.

RE: Doesn't work in Snow Leopard

Would you be willing to share the updated script? I'm interested in getting this to work in Snow Leopard.

Update for SL

To make it work in Snow Leopard, download the Exiftools package. It can be found here: http://www.sno.phy.queensu.ca/~phil/exiftool/.

Then update the script so the last section reads like this:

on get_ID(this_imagefile)
set this_imagefile to POSIX file this_imagefile -- in your own scripts you may need to remove this line for use with Mac-style file paths rather than the UNIX-style path that the iPhoto script returns.
set this_imagefile to this_imagefile as alias
set this_imagepath to the POSIX path of this_imagefile
if this_imagepath contains ".aplibrary" then
tell application "System Events"
set this_folder to the POSIX path of the container of this_imagefile
end tell
end if
set the scan_result to (do shell script "exiftool -fast -SpecialInstructions " & (quoted form of this_imagepath)) -- The fast option may not improve speed that much. Only when your Library is accessed over a slow network connection it may improve speed. But it won't hurt either.
if the scan_result is not "" then
set the scan_result to text from ((offset of ":" in scan_result) + 2) to -1 of the scan_result
if scan_result is "null" then set scan_result to missing value
else
set scan_result to missing value
end if
return scan_result
end get_ID

Rutger, thanks for posting

Rutger, thanks for posting your updated script.

By the way, EXIFTool is what GPS2Aperture uses to embed GPS data in the Masters - it's a wonderful tool!

Ian

Subscriptions