Opened 17 months ago

Closed 12 months ago

Last modified 12 months 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 17 months ago.
Patch to make GDALFindBestEntry() NoData?-aware

Download all attachments as: .zip

Change History (8)

Changed 17 months ago by larsl

Patch to make GDALFindBestEntry() NoData?-aware

comment:1 Changed 17 months ago by Even Rouault

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 Changed 17 months ago by Even Rouault

r33494 "Add explicit cast to please MSVC"

Last edited 17 months ago by Even Rouault (previous) (diff)

comment:3 Changed 17 months ago by antonio

Cc: antonio added

comment:4 Changed 14 months ago by Kurt Schwehr

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 Changed 14 months ago by Kurt Schwehr

Owner: changed from warmerdam to larsl
Status: reopenednew

comment:6 Changed 12 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 34427:

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

comment:7 Changed 12 months ago by Even Rouault

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

Note: See TracTickets for help on using tickets.