Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mapillary_tools/geotag/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def _is_reprocessable(metadata: types.MetadataOrError) -> bool:
exceptions.MapillaryGeoTaggingError,
exceptions.MapillaryVideoGPSNotFoundError,
exceptions.MapillaryExiftoolNotFoundError,
exceptions.MapillaryExifToolXMLNotFoundError,
),
):
return True
Expand Down
2 changes: 1 addition & 1 deletion mapillary_tools/geotag/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def index_rdf_description_by_path(
for xml_path in utils.find_xml_files(xml_paths):
try:
etree = ET.parse(xml_path)
except ET.ParseError as ex:
except Exception as ex:
verbose = LOG.isEnabledFor(logging.DEBUG)
if verbose:
LOG.warning("Failed to parse %s", xml_path, exc_info=True)
Expand Down
48 changes: 48 additions & 0 deletions tests/integration/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,3 +814,51 @@ def test_process_geotag_with_exiftool_xml_pattern(setup_data: py.path.local):
)

assert_descs_exact_equal(exiftool_descs, native_descs)


def test_process_geotag_with_exiftool_xml_pattern_missing_file(
setup_data: py.path.local,
):
video_path = setup_data.join("videos").join("sample-5s.mp4")
descs = run_process_for_descs(
[
*[
"--geotag_source",
json.dumps(
{
"source": "exiftool_xml",
"pattern": str(setup_data.join("gpx").join("%g.xml")),
}
),
],
str(video_path),
]
)

assert len(descs) == 1
assert descs[0]["error"]["type"] == "MapillaryExifToolXMLNotFoundError"


def test_process_geotag_with_exiftool_xml_pattern_fallback(
setup_data: py.path.local,
):
video_path = setup_data.join("videos").join("sample-5s.mp4")
descs = run_process_for_descs(
[
*[
"--geotag_source",
json.dumps(
{
"source": "exiftool_xml",
"pattern": str(setup_data.join("gpx").join("%g.xml")),
}
),
],
*["--geotag_source", "gpx"],
*["--geotag_source", "native"],
str(video_path),
]
)

assert len(descs) == 1
assert descs[0]["error"]["type"] == "MapillaryVideoGPSNotFoundError"
Loading