Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Remove duplicates when importing RAW images Apps
My camera can take RAW pictures, and can also store them in both a RAW and a JPEG format (i.e. RAW+). This is convenient when importing the pictures onto an iPad as the iPad doesn't need to decode the RAW pictures then on its own, which would be pretty slow.

When I later import these pictures from the iPad onto my Mac using iPhoto, I end up with duplicate items for each picture (the iPad groups them nicely together and shows only one item). This means that I see each picture twice in the iPhoto browser. I hope that Apple will eventually make iPhoto as smart as the Photos app on the iPad, by showing grouping the two formats for the same picture automatically. But until then, I like to tidy those dupes up myself.

I needed a way to seperate the RAW files from their JPEG twins. However, while iPhoto lets me search for items with a specific keyword (here: Raw), it seems to offer no way to find items not having a particular keyword, nor a way to invert a selection.

Automator offers the 'Filter iPhoto Photos' action, but that one seems to have a bug (as of July 2010) in which the is not operator for searching keywords doesn't work properly. So I wrote an AppleScript to sort it out.

How to find the non-RAW files in iPhoto

The script looks at all currently selected items in iPhoto and finds those that do not have the 'Raw' keyword. Those then get assigned the 'non-raw' keyword. With that 'non-raw' keyword, iPhoto lets me find these items easily so that I can, for instance, delete them, as I still have the RAW versions (I have to make sure, though, that I really do still have the RAW versions, as the script won't check that!).

Here's the AppleScript code. To use it, simply launch AppleScript Editor and paste the following code in, then save it as File Format: Application. To use it, first select the group of pictures from which you wish to identify the non-RAW images, and then run this script or application. You can then view the progress in iPhoto, where it adds the keywords to all non-Raw pictures you had selected.
  on run
   tell application "iPhoto"

    set selectedPictures to selection

    -- look at every selected picture
    repeat with img in selectedPictures

     -- check if the picture has a "Raw" keyword
     set isRaw to false
     set kws to keywords of img
     repeat with kw in kws
      if name of kw is equal to "Raw" then
       set isRaw to true
      end if
     end repeat

     -- add the "non-raw" keyword if the picture is not a raw picture
     if not isRaw then
      select img
      assign keyword string "non-raw"
     end if

    end repeat
   end tell
  end run
I'm sure the checking for 'Raw' keywords can be improved, as well as the script could collect all non-raw items first, finally set the selection and keyword only once. If you have improvement suggestions, please post them here or contact me through the link provided below.

(Note: I've also posted this on my own website.)

[crarko adds: I haven't tested this one, but did compile the script in AppleScript Editor successfully.]
    •    
  • Currently 1.78 / 5
  You rated: 4 / 5 (18 votes cast)
 
[8,999 views]  

Remove duplicates when importing RAW images | 3 comments | Create New Account
Click here to return to the 'Remove duplicates when importing RAW images' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Remove duplicates when importing RAW images
Authored by: jjasper on Jul 07, '10 11:38:46AM

When I import RAW images in my iPhoto library I also get the duplicate JPEG image, also movies shot with my camera store a JPEG thumbnail. All I do is type .jpg in the search field at the bottom of iPhoto and it brings up all the JPEG images for that Event. I then select all and move to trash.



[ Reply to This | # ]
Remove duplicates when importing RAW images
Authored by: scottbayes on Jul 08, '10 02:15:58AM

"However, while iPhoto lets me search for items with a specific keyword (here: Raw), it seems to offer no way to find items not having a particular keyword, nor a way to invert a selection. "

In iPhoto 09, Option-click the keyword in the palette to select only images NOT containing the keyword; additionally, Shift-click to use OR between keywords instead of AND. Shift and Option can be combined as required.

Inverting a complex selection is one I don't know how to do.



[ Reply to This | # ]
Remove duplicates when importing RAW images
Authored by: jjardoino on Jul 08, '10 12:00:53PM

I really can't understand the problem. My camera saves JPEG + RAW files too and I import them to iPhoto. But the first thing I do is selecting all the RAW files (I made a smart list for that) and masjk them. So I can keep the RAW files in iPhoto's library but they are not synchronized with the iPhone.

On my iPhone, I have only the JPEG files, no duplicates.

---
jjardoino
France
http://www.graffitix.com



[ Reply to This | # ]