-
Notifications
You must be signed in to change notification settings - Fork 137
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
Fails to extract AltitudeRef, but then crashes with "IndexError: list index out of range" #555
Comments
Thanks for providing the example image. It should be fixed in #557. Here is the output of processing: Note that since the altitude ref EXIF value is invalid, so it defaults to positive (above sea level):
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apparently some photos that have an altitude tag ["GPS GPSAltitude", "EXIF GPS GPSAltitude"]
somehow the altitude ref tag fails being extracted ["GPS GPSAltitudeRef", "EXIF GPS GPSAltitudeRef"]
This makes the script crash.
Basic information
python3 -m pip install --upgrade git+https://github.com/mapillary/mapillary_tools
Linux
Android
, using OpenCamera, and gcam in different modes (normal pic, photosphere, panorama)Steps to reproduce behavior
Start file upload Upload.
Expected behavior
finish upload, no error
Actual behavior
during the first scan, the following error is output:
$ mapillary_tools --verbose --verbose process_and_upload .
2022-10-03 12:50:24,784 - DEBUG - CLI param: verbose: True
2022-10-03 12:50:24,784 - DEBUG - CLI param: import_path: [PosixPath('.')]
2022-10-03 12:50:24,785 - DEBUG - CLI param: skip_subfolders: False
2022-10-03 12:50:24,785 - DEBUG - CLI param: skip_process_errors: False
2022-10-03 12:50:24,785 - DEBUG - CLI param: overwrite_all_EXIF_tags: False
2022-10-03 12:50:24,785 - DEBUG - CLI param: overwrite_EXIF_time_tag: False
2022-10-03 12:50:24,785 - DEBUG - CLI param: overwrite_EXIF_gps_tag: False
2022-10-03 12:50:24,785 - DEBUG - CLI param: overwrite_EXIF_direction_tag: False
2022-10-03 12:50:24,785 - DEBUG - CLI param: overwrite_EXIF_orientation_tag: False
2022-10-03 12:50:24,785 - DEBUG - CLI param: add_file_name: False
2022-10-03 12:50:24,785 - DEBUG - CLI param: add_import_date: False
2022-10-03 12:50:24,785 - DEBUG - CLI param: geotag_source: exif
2022-10-03 12:50:24,785 - DEBUG - CLI param: interpolation_use_gpx_start_time: False
2022-10-03 12:50:24,785 - DEBUG - CLI param: interpolation_offset_time: 0.0
2022-10-03 12:50:24,785 - DEBUG - CLI param: offset_angle: 0.0
2022-10-03 12:50:24,785 - DEBUG - CLI param: offset_time: 0.0
2022-10-03 12:50:24,785 - DEBUG - CLI param: cutoff_distance: 600.0
2022-10-03 12:50:24,785 - DEBUG - CLI param: cutoff_time: 60.0
2022-10-03 12:50:24,785 - DEBUG - CLI param: interpolate_directions: False
2022-10-03 12:50:24,785 - DEBUG - CLI param: duplicate_distance: 0.1
2022-10-03 12:50:24,785 - DEBUG - CLI param: duplicate_angle: 5.0
2022-10-03 12:50:24,785 - DEBUG - CLI param: file_types: {<FileType.IMAGE: 'image'>}
2022-10-03 12:50:24,785 - DEBUG - CLI param: dry_run: False
2022-10-03 12:50:25,123 - DEBUG - Found 8585 images in total
Traceback (most recent call last):
File "/home/user/.local/bin/mapillary_tools", line 8, in
sys.exit(main())
File "/home/user/.local/lib/python3.10/site-packages/mapillary_tools/commands/main.py", line 141, in main
args.func(argvars)
File "/home/user/.local/lib/python3.10/site-packages/mapillary_tools/commands/process_and_upload.py", line 18, in run
ProcessCommand().run(args)
File "/home/user/.local/lib/python3.10/site-packages/mapillary_tools/commands/process.py", line 242, in run
descs = process_geotag_properties(
File "/home/user/.local/lib/python3.10/site-packages/mapillary_tools/process_geotag_properties.py", line 181, in process_geotag_properties
return list(types.map_descs(_validate_and_fail_desc, geotag.to_description()))
File "/home/user/.local/lib/python3.10/site-packages/mapillary_tools/geotag/geotag_from_exif.py", line 72, in to_description
altitude = exif.extract_altitude()
File "/home/user/.local/lib/python3.10/site-packages/mapillary_tools/exif_read.py", line 126, in extract_altitude
ref, _ = self._extract_alternative_fields(fields, default=0, field_type=int)
File "/home/user/.local/lib/python3.10/site-packages/mapillary_tools/exif_read.py", line 110, in _extract_alternative_fields
return int(self.tags[field].values[0]), field
IndexError: list index out of range
Corresponding data
Additional information
This happened with 0.9.0 at about 90% of initial scanning, then I updated to 0.9.2 using
python3 -m pip install --upgrade git+https://github.com/mapillary/mapillary_tools
And now it happens much earlier in the process.
Unfortunately, the offending file is not shown, so I cannot attach an example of such a file.
adding --verbose once or even twice does not help
Suggestion: before starting to process a specific image, write the image filename to the debug log.
The text was updated successfully, but these errors were encountered: