Skip to content

odm_report: don't fail the task when the DEM preview cannot be generated - #2087

Open
Ghost7K wants to merge 1 commit into
OpenDroneMap:masterfrom
Ghost7K:report-hillshade-none
Open

Ghost7K wants to merge 1 commit into
OpenDroneMap:masterfrom
Ghost7K:report-hillshade-none

Conversation

@Ghost7K

@Ghost7K Ghost7K commented Oct 20, 2026

Copy link
Copy Markdown

Forum: https://community.opendronemap.org/t/25666 (several users)

Problem
generate_colored_hillshade() returns (None, None, None) when it fails (e.g. cannot import name '_gdal_array' on some installs). stages/odm_report.py then runs gdal_translate ... "None" and calls os.path.isfile(None), which raises TypeError – the whole task fails at the very end because of an optional preview image in the PDF report.

Fix
Only convert the hillshade if it exists, otherwise log a warning; skip None entries in the cleanup loop. The OpenSfM report already handles a missing dsm.png/dtm.png (it checks os.path.isfile), so the PDF is still produced, just without the DEM preview.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A6nSKVeapxTouZcAYh6UF6

…nnot be generated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@spwoodcock

Copy link
Copy Markdown
Member

This branch has not been deployed

No deployments
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