Skip to content

Fix 4-Bayer raws falling into 3-channel linear write path - #21463

Merged
TurboGit merged 1 commit into
darktable-org:masterfrom
andriiryzhkov:fix_4bayer
Jun 30, 2026
Merged

TurboGit merged 1 commit into
darktable-org:masterfrom
andriiryzhkov:fix_4bayer

Conversation

@andriiryzhkov

Copy link
Copy Markdown
Collaborator

Follow-up to #21429. @kofa73 caught a leftover mismatch in the LINEAR write path.

4-Bayer raws (CYGM/RGBE) classify as LINEAR per the prior June fix, but they keep a 1-channel mosaic buffer (mip_channels == 1) while the linear write loop writes 3 channels per pixel – clobbering neighbour pixels. Affected hardware is from 2000–2003 and largely unsupported by rawspeed today, but the mismatch is real.

Two small changes:

  • restore_raw_linear.c: guard the 3-channel write with mip_channels >= 3. 4-Bayer falls into a no-op branch and the original mosaic pixel survives from the upfront memcpy(patched, mbuf.buf, ...)
  • neural_restore.c: skip the "this image is already pre-demosaiced" toast for 4-Bayer in both batch and preview paths – it's misleading since 4-Bayer is a mosaic, not pre-demosaiced

@andriiryzhkov andriiryzhkov added this to the 5.6.1 milestone Jun 30, 2026
@andriiryzhkov andriiryzhkov added bugfix pull request fixing a bug scope: AI features AI features related issues and PR labels Jun 30, 2026

@TurboGit TurboGit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TurboGit
TurboGit merged commit 1f39920 into darktable-org:master Jun 30, 2026
5 checks passed
@andriiryzhkov
andriiryzhkov deleted the fix_4bayer branch June 30, 2026 18:33
Comment thread src/common/ai/restore_raw_linear.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug scope: AI features AI features related issues and PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants