Skip to content

Conversation

@bal-a
Copy link

@bal-a bal-a commented Nov 26, 2025

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:

pytest -s -vv tests

and observe it getting stuck after 181 tests.

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.
@meta-cla meta-cla bot added the cla signed label Nov 26, 2025
Copy link
Member

@ptpt ptpt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks Balys!

@bal-a bal-a requested a review from caglarpir November 27, 2025 13:30
@bal-a
Copy link
Author

bal-a commented Nov 27, 2025

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.

@bal-a bal-a force-pushed the bal/bugfix-thumbnail branch from c0d8465 to 6b2a36d Compare December 9, 2025 09:10
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")
Copy link
Author

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

@caglarpir caglarpir merged commit ceca21d into mapillary:main Dec 10, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants