Commit de51ee6
authored
fix(raw): fix channel layout (AcademySoftwareFoundation#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]>1 parent 2f0caf7 commit de51ee6
1 file changed
+16
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
249 | | - | |
| 248 | + | |
| 249 | + | |
250 | 250 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
268 | 256 | | |
269 | | - | |
| 257 | + | |
270 | 258 | | |
271 | 259 | | |
272 | 260 | | |
| |||
490 | 478 | | |
491 | 479 | | |
492 | 480 | | |
493 | | - | |
494 | 481 | | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | 482 | | |
500 | 483 | | |
501 | 484 | | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
509 | 491 | | |
510 | 492 | | |
511 | 493 | | |
| |||
676 | 658 | | |
677 | 659 | | |
678 | 660 | | |
679 | | - | |
| 661 | + | |
| 662 | + | |
680 | 663 | | |
681 | 664 | | |
682 | 665 | | |
| |||
0 commit comments