If any of these columns (windows_img_path, id_box, x, y, width & height) contain unexpected values, then one gets a cryptic error message at the moment.
Example of a current not-user-friendly error message when in the column windows_img_path one has a number instead of the expected absolute file path:
---------------------------
Error
---------------------------
Traceback (most recent call last):
File "c:\python38\lib\site-packages\PIL\Image.py", line 3096, in open
fp.seek(0)
AttributeError: 'numpy.float64' object has no attribute 'seek'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\...\field-img-taxa-annotation\vba_python_img_with_box\xlwings_test\xlwings_test_project.py", line 68, in main
display_img()
File "C:\...\field-img-taxa-annotation\vba_python_img_with_box\xlwings_test\xlwings_test_project.py", line 46, in display_img
with Image.open(img_path) as im:
File "c:\python38\lib\site-packages\PIL\Image.py", line 3098, in open
fp = io.BytesIO(fp.read())
AttributeError: 'numpy.float64' object has no attribute 'read'
Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------
When the absolute path has a typo, the error message is a bit more clear and can leave it as it is for now:
---------------------------
Error
---------------------------
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\...\field-img-taxa-annotation\vba_python_img_with_box\xlwings_test\xlwings_test_project.py", line 68, in main
display_img()
File "C:\...\field-img-taxa-annotation\vba_python_img_with_box\xlwings_test\xlwings_test_project.py", line 46, in display_img
with Image.open(img_path) as im:
File "c:\python38\lib\site-packages\PIL\Image.py", line 3092, in open
fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\...\\field-img\\2021-07-06\\Centaurea-scabiosa-01\\IMG_0377.JPG'
Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------
If any of these columns (
windows_img_path
,id_box
,x
,y
,width
&height
) contain unexpected values, then one gets a cryptic error message at the moment.Example of a current not-user-friendly error message when in the column
windows_img_path
one has a number instead of the expected absolute file path:When the absolute path has a typo, the error message is a bit more clear and can leave it as it is for now: