BMorearty / exportiphoto

Export iPhoto library to a folder structure
MIT License
140 stars 34 forks source link

Ignoring Missing Photos #12

Closed reidit closed 10 years ago

reidit commented 12 years ago

I've just been trying to use your exportiphoto.py utility but keep hitting a crash at the same point during the processing. I have iPhoto '11 so it may be that your code doesn't work fully with this?

Here's what I get:

 Processing 30 of 210: Roll 112 (5 images)...
 Created /Users/peter/iPhoto Export/2002None12None24 Roll 112
Traceback (most recent call last):
 File "exportiphoto.py", line 581, in
   library.walk([copyImage])
 File "exportiphoto.py", line 284, in walk
   func(imageId, targetFileDir, folderDate)
 File "exportiphoto.py", line 575, in copyImage
   library.copyImage(imageId, folderName, folderDate)
 File "exportiphoto.py", line 352, in copyImage
   shutil.copy2(mFilePath, tFilePath)
 File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/shutil.py", line 99, in copy2
   copyfile(src, dst)
 File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/shutil.py", line 52, in copyfile
   fsrc = open(src, 'rb')
IOError: [Errno 2] No such file or directory: u'/Users/peter/Pictures/iPhoto Library/Masters/2002/Roll 112/DCP_380_1.jpg'

Whilst it's likely that the problem is with my iPhoto library index, it would be useful if exportiphoto could be told to ignore such missing photos and continue exporting.

Thanks.

Peter Reid

eblass commented 12 years ago

...yes, confirmed with iLife '11.

Apparently some file are missing in the iPhoto directory structure. Problem does not go away if you repair the iPhoto database.

horak commented 10 years ago

I'm having the exact same issue, again with iLife '11. @eblass, @reidit have you found any workaround for this?

esalgado commented 10 years ago

You can have a look at this pull request, it worked for me with only one adition to the code!

Thanks.

horak commented 10 years ago

Thanks @esalgado!