diff --git a/app/raster_utils.py b/app/raster_utils.py index 933adb64..91b48a25 100644 --- a/app/raster_utils.py +++ b/app/raster_utils.py @@ -152,11 +152,9 @@ def export_raster(input, output, **opts): ci.index(ColorInterp.alpha) + 1) # Only 2 bands (common with thermal)? - elif len(ci) <= 2 and ColorInterp.gray in ci and ColorInterp.alpha in ci: - indexes = (ci.index(ColorInterp.gray) + 1, - ci.index(ColorInterp.gray) + 1, - ci.index(ColorInterp.gray) + 1, - ci.index(ColorInterp.alpha) + 1) + elif len(ci) == 2 and ColorInterp.gray in ci and ColorInterp.alpha in ci: + indexes = (ci.index(ColorInterp.gray) + 1,) * 3 + \ + (ci.index(ColorInterp.alpha) + 1, ) if ColorInterp.alpha in ci: mask = reader.read(ci.index(ColorInterp.alpha) + 1, window=win)