Repository navigation
Fix TIFF detection for camera-authored files (#281) - #480
Merged
Merged
Conversation
Member
|
Thank you @peiyan0! Requiring raw evidence before treating a Sony/Nikon/Pentax/Samsung TIFF as a raw is the right idea. It needs a few changes before it can land:
If you haven't already, please join our Discord: https://discord.gg/artcraft |
…Samsung/Pentax rules (storytold#281) Merge origin/main into storytold#480 and apply the review: - the Samsung-with-a-Pentax-maker-note -> PEF rule now also needs raw evidence; its test fixture gets a CFA photometric, and the same RGB file without it is not a raw; - for the Pentax family the Exif CFAPattern (0xa302) counts as raw evidence, as main's PEF reader takes its layout from it (uncompressed / PackBits PEFs); - Samsung's private raw compressions 32769..=32773 count for SRW (NX1 / NX500 use 32773); - the engine fallback in files.rs is dropped (main's version kept): a corrupt raw without a preview stays an import error; the engine regression test for camera-authored TIFFs is kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Thank you @peiyan0! This landed in #692. Following the review, I made these changes on your branch:
Please join our Discord if you haven't already: https://discord.gg/artcraft |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #281
Problem
When browsing folders that contain TIFF files preserving camera EXIF tags (e.g.
Make: SONY,Make: NIKON CORPORATION,Make: PENTAX,Make: RICOH,Make: SAMSUNG),lightcraft_raw::probe()previously checked onlymake.starts_with(...)without verifying that the file actually contained raw mosaic / CFA structures.As a result:
lightcraft_raw::probe()misclassified ordinary TIFF files as camera RAWs (ARW, NEF, NRW, PEF, SRW).probe_infoordecodefailed because ordinary TIFFs do not contain CFA mosaic data.probe_bytesto fail with"unsupported raw without an embedded preview".Solution
crates/raw/src/lib.rs:has_cfainprobe()for vendor raws (Nikon, Sony, Pentax/Ricoh, Samsung).has_raw_ifd(), include Pentax compression 65535, Sony tone curve (0x7010), and CFA pattern tags (0x828e,0x828d).crates/engine/src/files.rs:probe_infoordecodeand has no embedded preview, allow it to fall through to standard image decoders iflightcraft_codecscan decode it (as is the case with ordinary TIFFs).crates/rawandcrates/engineverifying that TIFFs with cameraMaketags are recognized and loaded as ordinary images rather than raw files.