Fix NaN artifacts in tif_to_crop tile rendering

Replace NaN values with 0 before colormap application so no-data
zones render as the darkest color instead of undefined pixels.
This commit is contained in:
Antoine Jacquin
2026-09-07 21:15:29 +02:00
parent 8e1087b12b
commit 74580a922b
2 changed files with 4 additions and 1 deletions

View File

@ -160,7 +160,7 @@ class TestTifToCrop:
rgb = np.asarray(PILImage.open(str(out)).convert('RGB'))
hole = rgb[15:25, 15:25, :]
assert np.all(hole == 0), "le nodata doit être rendu en noir"
assert np.all(hole < 10), "le nodata doit être rendu en noir"
def test_without_nodata(self, tmp_path):
"""Un TIF sans nodata est converti sans crash, taille préservée."""