Skip to content

Metadata: All Metadata shows the raw image's compression, Nikon's in words (#830) - #897

Closed
vbasky wants to merge 1 commit into
storytold:mainfrom
vbasky:fix/830-raw-image-compression
Closed

vbasky wants to merge 1 commit into
storytold:mainfrom
vbasky:fix/830-raw-image-compression

Conversation

@vbasky

@vbasky vbasky commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

The Compression row read IFD0, which in a TIFF-based raw describes the built-in preview — so every compressed NEF claimed "Uncompressed" (#830, seen on a Z 6II Lossless in #769).

  • The TIFF group's Compression row now comes from the main image IFD — the same full-resolution NewSubfileType 0 CFA/LinearRaw IFD the raw decoder opens — so NEFs read "Nikon NEF (Huffman compressed)", DNGs "Deflate"/"Lossy JPEG"/etc, and Sony ARWs their codec. Non-raw TIFFs have no such IFD and keep their own row; plain files are untouched.
  • Nikon files additionally get a Maker note group: NEF Compression is read from maker-note tag 0x0093 (not 0x0002 — that's ISO) through the existing parse_makernote (V1/V3 layouts) and spelled with the published Nikon value table — Lossless, Lossy (type 1/2), Packed 12/14 bits, High Efficiency (Z-series), Uncompressed (reduced to 12 bits) … — unknown values print as stored, and only NEFs get the row.

Tests build an NEF-shaped file with the existing TIFF writer and pin: compressed/uncompressed/high-efficiency combinations, the unknown-value fallback, the Sony (no-note) and plain-TIFF paths. meta/engine/raw/catalog suites, fmt, clippy and cargo xtask layers clean.

For the reporter's Z 6II: the row now reads "Nikon NEF (Huffman compressed)" with "NEF Compression: Lossless" under Maker note.

…words (storytold#830).

IFD0 describes a raw file's built-in preview, so its Compression tag named the
thumbnail, not the sensor data: every compressed NEF read "Uncompressed". The
TIFF group's Compression row is now taken from the main image IFD (the same
full-resolution CFA/LinearRaw the raw decoder opens), gaining name spellings for
Nikon's and Sony's raw codecs; a non-raw TIFF keeps its own row untouched.

Nikon NEFs additionally get a "Maker note" group whose NEF Compression row reads
tag 0x0093 from the maker note through the existing parse_makernote and spells it
with the published Nikon value table (Lossless, Packed 14 bits, High Efficiency
(Z-series), …), falling back to the raw number for unknown values.

Copy link
Copy Markdown
Member

Closing as a duplicate of #831, which was opened first and landed in #975 with the same fix for #830. Thanks!


Generated by Claude Code

@bflatastic bflatastic closed this Oct 11, 2026
@vbasky
vbasky deleted the fix/830-raw-image-compression branch October 11, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants