Skip to content

gamut-tiff: hoist the scoped sub-IFD resolver into gamut-ifd and delete the local copy #580

Description

@justin13888

crates/gamut-tiff/src/metadata.rs carries resolve_pointers, a restatement of
gamut_ifd::reader::resolve_pointers_with. Inside the subtree it walks, the two are
indistinguishable — same pointer-type rule, same cycle guard, same "too deep" message — and the
copy exists for one reason only: gamut_ifd::read_tree resolves the flat tag list it is handed at
every node of every page, while TiffDecoder::metadata must resolve it over IFD 0's subtree
and nowhere else
. A pointer on a page whose content the seam discards was failing the whole call
(#520, rounds 1-3).

Two copies of one walk is a drift hazard: the local one has since gained a BTreeSet visited set
and a tighter depth bound, and the shared one has neither. The scoping the copy exists for is a
gamut-ifd surface, not a gamut-tiff decision.

What is wanted is an entry point in gamut-ifd that resolves a pointer list over one
directory's subtree
, given a directory already parsed out of a file — read_ifd_at plus the
guards, which is exactly resolve_pointers_with with its fetch closure exposed. gamut-tiff
then calls it and deletes its copy; gamut-dng, which degrades rather than fails, is a second
plausible consumer.

It could not be done in #520: that PR is stacked on #508 and its manifest is crates/gamut-tiff/,
so touching gamut-ifd was out of scope. Do it once the stack has merged.

Filed from the review of #520.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions