Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(raw): fix channel layout (#4516)
The function libraw_filter_to_str() converts the `imgdata.idata.filters` field to human readable form, by mapping a few hardcoded values. I found the issue by converting images with disabled demosaicing, which writes the Bayer pattern into the ImageBuf metadata. The Panasonic GX9 didn't have any pattern recognised; The Canon R5 was incorrectly recognised as GMCY. The `imgdata.idata.filters` actually contains a sequence of 2-bit values, where each represents an index in a 4-character long string `imgdata.idata.cdesc`. I have modified the code to extract the channels from `imgdata.idata.cdesc` as expected. I have also disabled the normalisation code, which I believe was incorrect, and never executed due to the issue above. The current tests pass, however, I'll start a discussion on the piece of code I have concerns with. --------- Signed-off-by: Anton Dukhovnikov <[email protected]>
- Loading branch information