Sometimes if the EXIF data of the image to be sent does not contain the "Orientation" key, a KeyError will be raised.
Traceback (most recent call last):
File "./bin/opendrop", line 10, in <module>
sys.exit(main())
File "./lib/python3.6/site-packages/opendrop/cli.py", line 38, in main
AirDropCli(sys.argv[1:])
File "./lib/python3.6/site-packages/opendrop/cli.py", line 87, in __init__
self.send()
File "./lib/python3.6/site-packages/opendrop/cli.py", line 160, in send
if not self.client.send_ask(self.file):
File "./lib/python3.6/site-packages/opendrop/client.py", line 150, in send_ask
icon = AirDropUtil.generate_file_icon(f.name)
File "./lib/python3.6/site-packages/opendrop/util.py", line 180, in generate_file_icon
orientation = exif['Orientation']
KeyError: 'Orientation'
Fix: I've added an except statement for the KeyError.
Sometimes if the EXIF data of the image to be sent does not contain the "Orientation" key, a KeyError will be raised.
Fix: I've added an except statement for the KeyError.
Great project! 🍻