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 authored and ralphraul committed Mar 11, 2024
1 parent 424a6eb commit 03f9d58
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 03f9d58

Please sign in to comment.