-
Notifications
You must be signed in to change notification settings - Fork 141
bugfix/gracefully-handle-large-thumbnails #787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary: User report: mapillary_tools crashes when trying to upload the attached set of images. Also, there is no mention on which image is causing the crash, meaning the user has to hunt through potentially thousands of images to find the misbehaving one. Traceback (most recent call last): File "main.py", line 8, in <module> File "mapillary_tools\commands\__main__.py", line 164, in main File "mapillary_tools\commands\process_and_upload.py", line 33, in run File "mapillary_tools\commands\upload.py", line 75, in run File "mapillary_tools\upload.py", line 117, in upload File "mapillary_tools\upload.py", line 108, in upload File "mapillary_tools\upload.py", line 631, in _continue_or_fail File "mapillary_tools\uploader.py", line 517, in upload_images File "mapillary_tools\uploader.py", line 543, in _upload_sequence File "concurrent\futures\_base.py", line 619, in result_iterator File "concurrent\futures\_base.py", line 317, in _result_or_cancel File "concurrent\futures\_base.py", line 449, in result File "concurrent\futures\_base.py", line 401, in __get_result File "concurrent\futures\thread.py", line 59, in run File "mapillary_tools\uploader.py", line 602, in upload File "mapillary_tools\uploader.py", line 643, in dump_image_bytes File "mapillary_tools\exif_write.py", line 201, in dump_image_bytes File "mapillary_tools\exif_write.py", line 186, in _safe_dump File "mapillary_tools\exif_write.py", line 153, in _safe_dump File "piexif\_dump.py", line 94, in dump ValueError: Given thumbnail is too large. max 64kB [PYI-9472:ERROR] Failed to execute script 'main' due to unhandled exception! "But I guess the actual problems are quite clear: (1) ValueError: Given thumbnail is too large. max 64kB, Mapillary needs to gracefully handle that situation and (2) on file errors, Mapillary needs to report the failing image name." Test Plan: Added unit tests, ran the existing ones as described in README. It looks like the tests get stuck on tests/unit/test_persistent_cache.py::test_multithread_shared_cache_comprehensive but I believe this is unrelated to the change. To reproduce test getting stuck run: ``` pytest -s -vv tests ``` and observe it getting stuck after 181 tests.
ptpt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks Balys!
|
As part of the validation, ran formatter, which was not ran before. Since the formatting changes are trivial, I kept it in the same commit as the PR follow up comments. |
c0d8465 to
6b2a36d
Compare
| test_exif.copy(test_exif2) | ||
| test_exif3 = setup_unittest_data.join("test_exif_3.jpg") | ||
| test_exif.copy(test_exif3) | ||
| fixed_exif = setup_unittest_data.join("fixed_exif.jpg") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linter complaining, not used, deleted
User report:
mapillary_tools crashes when trying to upload the attached set of images.
Also, there is no mention on which image is causing the crash, meaning the user has to hunt through potentially thousands of images to find the misbehaving one.
Traceback (most recent call last):
File "main.py", line 8, in
File "mapillary_tools\commands_main_.py", line 164, in main File "mapillary_tools\commands\process_and_upload.py", line 33, in run File "mapillary_tools\commands\upload.py", line 75, in run File "mapillary_tools\upload.py", line 117, in upload File "mapillary_tools\upload.py", line 108, in upload File "mapillary_tools\upload.py", line 631, in _continue_or_fail File "mapillary_tools\uploader.py", line 517, in upload_images File "mapillary_tools\uploader.py", line 543, in _upload_sequence File "concurrent\futures_base.py", line 619, in result_iterator File "concurrent\futures_base.py", line 317, in _result_or_cancel File "concurrent\futures_base.py", line 449, in result File "concurrent\futures_base.py", line 401, in __get_result File "concurrent\futures\thread.py", line 59, in run File "mapillary_tools\uploader.py", line 602, in upload File "mapillary_tools\uploader.py", line 643, in dump_image_bytes File "mapillary_tools\exif_write.py", line 201, in dump_image_bytes File "mapillary_tools\exif_write.py", line 186, in _safe_dump File "mapillary_tools\exif_write.py", line 153, in _safe_dump File "piexif_dump.py", line 94, in dump
ValueError: Given thumbnail is too large. max 64kB [PYI-9472:ERROR] Failed to execute script 'main' due to unhandled exception!
"But I guess the actual problems are quite clear: (1) ValueError: Given thumbnail is too large. max 64kB, Mapillary needs to gracefully handle that situation and (2) on file errors, Mapillary needs to report the failing image name."
Test Plan:
Added unit tests, ran the existing ones as described in README.
It looks like the tests get stuck on
tests/unit/test_persistent_cache.py::test_multithread_shared_cache_comprehensive
but I believe this is unrelated to the change.
To reproduce test getting stuck run:
and observe it getting stuck after 181 tests.