Skip to content

feat:metadata expose MetadataCursor and add accessors for ImageFileDirectoryReader#241

Open
feefladder wants to merge 5 commits intodevelopmentseed:mainfrom
feefladder:public-cursor
Open

feat:metadata expose MetadataCursor and add accessors for ImageFileDirectoryReader#241
feefladder wants to merge 5 commits intodevelopmentseed:mainfrom
feefladder:public-cursor

Conversation

@feefladder
Copy link
Contributor

#82 gives the user control over metadata reading, and some methods of MetadataCursor were public, but not the type itself. This allows the user to read tag type, count and value by themselves if they want to do complex metadata caching.

@kylebarron
Copy link
Member

Thanks; I need to think about this though. There's a proliferation of public APIs and I'd much rather figure out how to remove public APIs than add new ones.

@feefladder
Copy link
Contributor Author

I understand. there's two pathways I see here:

  1. minimize methods on MetadataCursor (new(),with_offset,new_with_offset,seek)
  2. Don't expose MetadataCursor at all.
    • add a ImageFileDirectoryReader.peek_tag(&self, tag_offset: u64) -> (Tag, TagType, count: u64, Option<offset: u64>) function.
    • This could stand on its own, or (Optional) refactor the read_tag,read_tag_value functions:
      1. peek_tag, if Some(offset) -> move cursor
      2. read tag value from cursor
        But I think the refactor loses the scope of this PR and would fit a separate PR (if at all).
    • I've made a sample implementation here for the peek_tag function.

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