Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#6371 closed defect (fixed)

[PATCH] gdaladdo inserts nodata values where they shouldn't be

Reported by: larsl Owned by: larsl
Priority: normal Milestone: 2.1.0
Component: Algorithms Version: svn-trunk
Severity: normal Keywords:
Cc: antonio

Description

Sometimes when gdaladdo generates overview layers for a band with a colour tables and a NODATA value it inserts NODATA pixels in the overview even though there are no NODATA pixels in the corresponding pixels in the source layer. This is because GDALFindBestEntry(), which finds the colour table entry whose colour best matches the averaged RGB value, doesn't care if the best match is NODATA or not. The attached patch makes GDALFindBestEntry() NODATA-aware, which fixes this bug for the 'average' and 'gauss' resampling methods.

Attachments (1)

0001-Make-GDALFindBestEntry-NODATA-aware.patch (2.6 KB ) - added by larsl 8 years ago.
Patch to make GDALFindBestEntry() NoData-aware

Download all attachments as: .zip

Change History (8)

by larsl, 8 years ago

Patch to make GDALFindBestEntry() NoData-aware

comment:1 by Even Rouault, 8 years ago

Milestone: 2.1.0
Resolution: fixed
Status: newclosed

trunk r33492 "Overview: Make average and gauss methods aware of transparent color table entries (patch by Lars Luthman, #6371 + test added and check for c4 == 0)"

comment:2 by Even Rouault, 8 years ago

r33494 "Add explicit cast to please MSVC"

Last edited 8 years ago by Even Rouault (previous) (diff)

comment:3 by antonio, 8 years ago

Cc: antonio added

comment:4 by Kurt Schwehr, 8 years ago

Resolution: fixed
Status: closedreopened

larsl, Can you explain how the patch works? It would very helpful to have a paragraph describing how your patch works.

comment:5 by Kurt Schwehr, 8 years ago

Owner: changed from warmerdam to larsl
Status: reopenednew

comment:6 by Even Rouault, 8 years ago

Resolution: fixed
Status: newclosed

In 34427:

Overview building: simplify logic related to nodata/transparent color table entry handling (fix #6371)

comment:7 by Even Rouault, 8 years ago

r34429 "Fix MSVC warning about precision loss (ref #6371)"

Note: See TracTickets for help on using tickets.