jmathai / elodie

An EXIF-based photo assistant, organizer and workflow automation tool.
https://bit.ly/introducing-elodie
Apache License 2.0
1.27k stars 139 forks source link

'NoneType' object has no attribute '__getitem__' #84

Closed davisonio closed 8 years ago

davisonio commented 8 years ago

Hi, I recently got this error when importing my photos for the first time on OS X:

Traceback (most recent call last):
  File "./elodie.py", line 228, in <module>
    main()
  File "/Library/Python/2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/Library/Python/2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Python/2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Python/2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "./elodie.py", line 94, in _import
    trash)
  File "./elodie.py", line 55, in import_file
    media, allowDuplicate=False, move=False)
  File "/Users/craig/.elodie/elodie/elodie/filesystem.py", line 180, in process_file
    directory_name = self.get_folder_path(metadata)
  File "/Users/craig/.elodie/elodie/elodie/filesystem.py", line 146, in get_folder_path
    if(metadata['date_taken'] is not None):
TypeError: 'NoneType' object has no attribute '__getitem__'
jmathai commented 8 years ago

@davisonio can you link to or email me the photo which caused this error? jaisen (at) jmathai (dot) com

srynot4sale commented 8 years ago

Hi @jmathai - just hit this error myself. Easy to replicate:

$ mkdir /tmp/dest $ mkdir /tmp/source $ touch /tmp/source/notaimage.jpg $ elodie.py import --destination="/tmp/dest" /tmp/source/

jmathai commented 8 years ago

Thanks @srynot4sale. Merged your PR and added a few tests.

@davisonio can you pull and verify that you no longer receive the error?

davisonio commented 8 years ago

can you pull and verify that you no longer receive the error?

Yes I no longer receive the error anymore.

Thanks so much @jmathai and @srynot4sale :smile: