fix(IBA): Handle offset data windows in fillholes_pushpull#5105
Open
lgritz wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
Open
fix(IBA): Handle offset data windows in fillholes_pushpull#5105lgritz wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
lgritz wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
Conversation
Fixes 4942 IBA::fillholes_pushpull() produced incorrect result when the source image had a non-zero data window origin (such as exr files with overscan). Two interrelated bugs: 1. The paste() call double-applied the data window offset. paste() maps source pixel (0,0) to destination (xbegin,ybegin), but since the source data starts at (x,y), passing (x,y) as the offset shifted every pixel by an extra (x,y). Pixels in the negative-coordinate region landed outside the destination buffer and were silently lost. 2. The top pyramid level preserved the original display/full window while all smaller levels had full=data at (0,0). Since resize() uses the full window for coordinate mapping, it only sampled the display window portion of the top level, losing all overscan data. Fix by shifting the top pyramid level to origin (0,0) with full=data, making all levels coordinate-consistent. The initial paste translates source pixels into the origin-based pyramid, and the final paste (which was already using src origin offsets) correctly translates back. Add test cases in testsuite/oiiotool for fillholes with an offset data window, and an offset display window, to ensure that both cases work. Also, for the existing fillholes related test, move the source image from ref (never should have been there) to src. Assisted-by: Claude Code / claude-opus-4-6 Signed-off-by: Larry Gritz <lg@larrygritz.com>
cb30232 to
1ffde5d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4942
IBA::fillholes_pushpull() produced incorrect results when the source image had a non-zero data window origin (such as exr files with overscan).
Two interrelated bugs:
The paste() call double-applied the data window offset. paste() maps source pixel (0,0) to destination (xbegin,ybegin), but since the source data starts at (x,y), passing (x,y) as the offset shifted every pixel by an extra (x,y). Pixels in the negative-coordinate region landed outside the destination buffer and were silently lost.
The top pyramid level preserved the original display/full window while all smaller levels had full=data at (0,0). Since resize() uses the full window for coordinate mapping, it only sampled the display window portion of the top level, losing all overscan data.
Fix by shifting the top pyramid level to origin (0,0) with full=data, making all levels coordinate-consistent. The initial paste translates source pixels into the origin-based pyramid, and the final paste (which was already using src origin offsets) correctly translates back.
Add test cases in testsuite/oiiotool for fillholes with an offset data window, and an offset display window, to ensure that both cases work.
Also, for the existing fillholes related test, move the source image from ref (never should have been there) to src.
Assisted-by: Claude Code / claude-opus-4-6