Skip to content

Expose methods related to reading directory#278

Merged
197g merged 6 commits intomainfrom
read-directory
Jul 12, 2025
Merged

Expose methods related to reading directory#278
197g merged 6 commits intomainfrom
read-directory

Conversation

@197g
Copy link
Member

@197g 197g commented Jul 8, 2025

This reworks the internals of Decoder as a side effect, in particular groups all attributes needed to correctly interpret Entry as an ifd::Value. The main reason is that it simplifies borrow-checking however it also simplifies some interfaces where we previously passed those values as separate arguments despite needing them together.

Newly public interfaces are:

  • ifd::Value::into_ifd_pointer, ifd::Value::into_ifd_vec
  • decoder::Decoder::read_directory
  • decoder::Decoder::read_directory_tags
  • decoder::IfdDecoder

@197g 197g force-pushed the read-directory branch from fe4b226 to 57bbd4c Compare July 8, 2025 10:18
197g added 4 commits July 11, 2025 14:12
This allows us to recombine the reader and other file data in a Decoder
with any IFD, whether that of an image or an extension IFD as indicated
by an IFD pointer such as Exif and GPS.
@197g 197g force-pushed the read-directory branch from 57bbd4c to f021e3e Compare July 11, 2025 12:12
Having the value reader itself take care of the bigtiff and limit
semantics is a little cleaner, with the TagReader being responsible
for the interface of grabbing specific types of IFD values.
@197g 197g force-pushed the read-directory branch from 59f4bba to e62cdfb Compare July 11, 2025 13:09
@197g 197g mentioned this pull request Jul 11, 2025
@Shnatsel
Copy link
Member

Shnatsel commented Jul 12, 2025

I would appreciate an addition to the docs on pub fn read_directory and/or the Directory type, because as a non-expert in TIFF I have no idea what this means. From the title I expected it to be a filesystem directory, but the type signatures make me think that it's not.

@197g
Copy link
Member Author

197g commented Jul 12, 2025

@Shnatsel PTAL at the added documentation?

@Shnatsel
Copy link
Member

Looks good to me, thank you!

@197g 197g merged commit 02699c9 into main Jul 12, 2025
15 checks passed
@197g 197g deleted the read-directory branch July 12, 2025 15:23
@197g
Copy link
Member Author

197g commented Jul 12, 2025

I'm going to do a pass over the Decoder interface so that it works with the Encoder. And then turn to next_* as discussed here.

This was referenced Jul 19, 2025
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.

3 participants