Commit 3fdbbde
Balys Anikevicius
bugfix/gracefully-handle-large-thumbnails
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.1 parent 6823dba commit 3fdbbde
File tree
4 files changed
+107
-0
lines changed- mapillary_tools
- tests/unit
4 files changed
+107
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
217 | 229 | | |
218 | 230 | | |
219 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
797 | 797 | | |
798 | 798 | | |
799 | 799 | | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
800 | 804 | | |
801 | 805 | | |
802 | 806 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
260 | 263 | | |
261 | 264 | | |
262 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
263 | 353 | | |
264 | 354 | | |
265 | 355 | | |
| |||
0 commit comments