Skip to content

Commit 8aa14b6

Browse files
authored
Merge pull request #775 from mapillary/fix-gpx-filesize
Calculate video filesize when using gpx extractor
2 parents b7b5f82 + 785e2b6 commit 8aa14b6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

mapillary_tools/geotag/video_extractors/gpx.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
else:
1313
from typing_extensions import override
1414

15-
from ... import exceptions, geo, telemetry, types
15+
from ... import exceptions, geo, telemetry, types, utils
1616
from ..utils import parse_gpx
1717
from .base import BaseVideoExtractor
1818
from .native import NativeVideoExtractor
@@ -59,6 +59,7 @@ def extract(self) -> types.VideoMetadata:
5959
self._rebase_times(gpx_points)
6060
return types.VideoMetadata(
6161
filename=self.video_path,
62+
filesize=utils.get_file_size(self.video_path),
6263
filetype=types.FileType.VIDEO,
6364
points=gpx_points,
6465
)

tests/integration/test_process.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ def test_process_video_geotag_source_with_gpx_specified(setup_data: py.path.loca
602602

603603
assert len(descs) == 1
604604
assert len(descs[0]["MAPGPSTrack"]) > 0
605+
assert descs[0]["filesize"] == 2848208
605606

606607

607608
def test_process_video_geotag_source_gpx_not_found(setup_data: py.path.local):

0 commit comments

Comments
 (0)