-
Notifications
You must be signed in to change notification settings - Fork 612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix] raw: fix channel layout #4516
[fix] raw: fix channel layout #4516
Conversation
Signed-off-by: Anton Dukhovnikov <[email protected]>
src/raw.imageio/rawinput.cpp
Outdated
case 0x49494949: return "GBGR"; | ||
case 0x94949494: return "RGBG"; | ||
default: break; | ||
char result[5] = { 0 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't actually know... does this for sure fill the whole array with 0's? Is that part of the C++ standard, and not relying on any particular compiler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM pending one minor comment I made asking for clarification about the array initialization.
Signed-off-by: Anton Dukhovnikov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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]>
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]>
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]>
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]>
Description
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 stringimgdata.idata.cdesc
. I have modified the code to extract the channels fromimgdata.idata.cdesc
as expected.I have also disabled the normalisation code, which I believe was incorrect, and never executed due to the issue above.
Tests
The current tests pass, however, I'll start a discussion on the piece of code I have concerns with.
Checklist:
need to update the documentation, for example if this is a bug fix that
doesn't change the API.)
(adding new test cases if necessary).
corresponding Python bindings (and if altering ImageBufAlgo functions, also
exposed the new functionality as oiiotool options).
already run clang-format before submitting, I definitely will look at the CI
test that runs clang-format and fix anything that it highlights as being
nonconforming.