Skip to content

Commit

Permalink
gdal_footprint: really fix datasets with alpha band, by vectorizing o…
Browse files Browse the repository at this point in the history
…nly the alpha band and not the other ones (really fixes OSGeo#8792, fixes OSGeo#8834)
  • Loading branch information
rouault committed Nov 27, 2023
1 parent d03a17c commit a3c57a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions apps/gdal_footprint_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,7 @@ static bool GDALFootprintProcess(GDALDataset *poSrcDS, OGRLayer *poDstLayer,
{
GDALRasterBand *poMaskBand;
const int nMaskFlags = poBand->GetMaskFlags();
if ((nMaskFlags & GMF_ALPHA) != 0 ||
poBand->GetColorInterpretation() == GCI_AlphaBand)
if (poBand->GetColorInterpretation() == GCI_AlphaBand)
{
poMaskBand = poBand;
}
Expand Down
3 changes: 1 addition & 2 deletions autotest/utilities/test_gdal_footprint_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,7 @@ def test_gdaldem_footprint_rgba_overviews():
for i in range(4):
src_ds.GetRasterBand(i + 1).SetColorInterpretation(gdal.GCI_RedBand + i)
src_ds.BuildOverviews("NONE", [2])
for i in range(4):
src_ds.GetRasterBand(i + 1).GetOverview(0).WriteRaster(1, 1, 1, 1, b"\xFF")
src_ds.GetRasterBand(4).GetOverview(0).WriteRaster(1, 1, 1, 1, b"\xFF")
out_ds = gdal.Footprint(
"",
src_ds,
Expand Down

0 comments on commit a3c57a2

Please sign in to comment.