Skip to content

Commit 5b6c412

Browse files
committed
Refactor
1 parent c287fa4 commit 5b6c412

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

app/raster_utils.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,9 @@ def export_raster(input, output, **opts):
152152
ci.index(ColorInterp.alpha) + 1)
153153

154154
# Only 2 bands (common with thermal)?
155-
elif len(ci) <= 2 and ColorInterp.gray in ci and ColorInterp.alpha in ci:
156-
indexes = (ci.index(ColorInterp.gray) + 1,
157-
ci.index(ColorInterp.gray) + 1,
158-
ci.index(ColorInterp.gray) + 1,
159-
ci.index(ColorInterp.alpha) + 1)
155+
elif len(ci) == 2 and ColorInterp.gray in ci and ColorInterp.alpha in ci:
156+
indexes = (ci.index(ColorInterp.gray) + 1,) * 3 + \
157+
(ci.index(ColorInterp.alpha) + 1, )
160158

161159
if ColorInterp.alpha in ci:
162160
mask = reader.read(ci.index(ColorInterp.alpha) + 1, window=win)

0 commit comments

Comments
 (0)