-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(oiiotool): Overhaul and fix bugs in mixed-channel propogation (#4127
) Remember that ImageBuf only stores one pixel data type per buffer, but of course they may have differing-per-channel types in image files. So how does oiiotool know what to write? There is a series of heuristics: -d is for explicit user control, if not, then try to deduce it from the input files. A bedrock precept is that `oiiotool in.exr -o out.exr` ought to write the same channel types that it read in. The logic to implement this with the various image operations and possible overrides can be hard to get right. Indeed, I did not get it right. It made mistakes even in simple cases like the above. And the code was complicated and hard to understand, as well. This PR rewrites a couple functions that implement this chunk of this logic, both correcting several errors as well as (I hope) being clearer and better commented so that we can more easily reason about it and modify it in the future. I also added some additional tests to testsuite/perchannel to verify some of the cases that were previously failing. Signed-off-by: Larry Gritz <[email protected]>
- Loading branch information
Showing
3 changed files
with
91 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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