While importing a My Pictures directory from Windows XP into iPhoto via drag-and-drop, the process would crash after several thousand photos. I suspected iPhoto was choking on a non-JPG file, so I recursively deleted all other files in the directory:
find . \( \! -iname "*\.jpg" \! -iname "*\.jpeg" -type f \) -print
find . \( \! -iname "*\.jpg" \! -iname "*\.jpeg" -type f \) -print0
find . \( \! -iname "*\.jpg" \! -iname "*\.jpeg" -type f \) -print0 | xargs -0 rm -f
Sure enough, after cleaning the directory of extraneous filetypes, the import worked flawlessly. Use the above commands at your own risk - unintended data loss is likely. As always: backup, backup, backup. (Thanks to Todd for his post, from which the above commands were largely lifted.)
/mac | Nov 15, 2007