Channel misalignment / Color fringing with linear Pixel-Shift DNGs (Oversized StripByteCounts)
Bug Description:
When parsing linear (demosaiced) Pixel-Shift DNGs (e.g., generated from Leica SL2 / SL3), LibRaw introduces a systematic channel shift, resulting in heavy color fringing along all contrast edges.
Technical Details:
The issue is directly tied to padding bytes within the image data block. ExifTool throws the following warning for the affected DNGs:
Warning: [minor] Oversized SubIFD StripByteCounts (330277888 bytes, but expected 330277500)
While Adobe software (Lightroom, Camera Raw) successfully ignores these 388 excess padding bytes and renders the image perfectly, LibRaw appears to parse them. This byte offset disrupts the 1:1 mapping of the linear RGB grid, shifting the color channels asynchronously and destroying the demosaiced image structure.
Steps to Reproduce / What failed:
Open the linear Pixel-Shift DNG in any software relying on LibRaw (e.g., ART, RawTherapee).
Result: Heavy color fringing (subpixel channel offset).
Attempted workarounds that failed: Converting to DNG 1.7.1 via Adobe DNG Converter (Adobe retains the padding), nulling raw_crop in camconst.json, or stripping MakerNotes/Camera IDs via ExifTool.
Expected Behavior:
LibRaw should respect the expected byte count (330,277,500 bytes based on resolution) and ignore the oversized StripByteCounts padding at the end of the lines/block, ensuring the linear RGB channels align perfectly.

Please upload a sample linear
Please upload a sample linear pixel-shift DNG file to a file exchange server (Dropbox, Google Drive, WeTransfer are some of the free ones) and e-mail us a link to download it.
-- Alex Tutubalin @LibRaw LLC