Skip to content

Fix --build-overviews: add missing space in gdaladdo arguments - #2059

Merged
smathermather merged 1 commit into
OpenDroneMap:masterfrom
jousby:jousby/fix-build-overviews-space
Aug 4, 2026
Merged

Fix --build-overviews: add missing space in gdaladdo arguments#2059
smathermather merged 1 commit into
OpenDroneMap:masterfrom
jousby:jousby/fix-build-overviews-space

Conversation

@jousby

@jousby jousby commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Adds a missing trailing space to one string literal in build_overviews().

Problem

Python concatenates adjacent string literals at compile time, so the command built in opendm/orthophoto.py came out as:

gdaladdo -r average --config BIGTIFF_OVERVIEW IF_SAFER --config COMPRESS_OVERVIEW JPEG \
  --config INTERLEAVE_OVERVIEW PIXEL \
  --config PHOTOMETRIC_OVERVIEW YCBCR/datasets/code/odm_orthophoto/odm_orthophoto.tif 2 4 8 16

The orthophoto path is consumed as the value of --config PHOTOMETRIC_OVERVIEW, leaving 2 as the first positional argument — so gdaladdo tries to open 2 as its input raster and exits non-zero. system.run raises SubprocessException, and the run aborts at the odm_orthophoto stage rather than degrading.

The preceding INTERLEAVE_OVERVIEW PIXEL line already has its trailing space; only the PHOTOMETRIC_OVERVIEW line was missing one.

Affected

Introduced by #1935 ("Add interleave=pixel and photometric=ycbcr for orthophoto overviews by default"). Affects 3.6.0, 3.6.1, and master; 3.5.6 predates the PHOTOMETRIC_OVERVIEW line and is unaffected.

Triggered by any georeferenced reconstruction that reaches post_orthophoto_steps with --build-overviews and without --cog. The failure lands at the end of the pipeline, after SfM and MVS have completed.

Verification

Extracted the concatenated template from build_overviews() and formatted it with a sample path, before and after:

# before
... --config PHOTOMETRIC_OVERVIEW YCBCR/datasets/code/odm_orthophoto/odm_orthophoto.tif 2 4 8 16

# after
... --config PHOTOMETRIC_OVERVIEW YCBCR /datasets/code/odm_orthophoto/odm_orthophoto.tif 2 4 8 16

I have not run a full pipeline against this branch — the check above covers the argument construction, which is the whole of the defect.

Notes

Reported as #2058, which was closed automatically by the triage bot shortly after it was opened; it has not been fixed on master.

Kept deliberately to one character. If it would be useful, a follow-up could build the gdaladdo arguments as a list and ' '.join(...) them, which would make the separator structural rather than a matter of remembering the trailing space — happy to open that separately if you want it.

🤖 Generated with Claude Code

Adjacent string literals are concatenated at compile time, so the missing
trailing space after YCBCR made gdaladdo receive the orthophoto path as the
value of --config PHOTOMETRIC_OVERVIEW:

    ... --config PHOTOMETRIC_OVERVIEW YCBCR/path/to/odm_orthophoto.tif 2 4 8 16

gdaladdo then treats "2" as its input raster and exits non-zero, which
system.run turns into a SubprocessException, aborting the run at the
odm_orthophoto stage.

Introduced in OpenDroneMap#1935; affects 3.6.0 and 3.6.1.

Fixes OpenDroneMap#2058

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@smathermather
smathermather merged commit 956ff8a into OpenDroneMap:master Aug 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants