pub struct ImageFileDirectoryReader { /* private fields */ }Expand description
Reads the ImageFileDirectory metadata.
TIFF metadata is not necessarily contiguous in the files: IFDs are normally all stored contiguously in the header, but the spec allows them to be non-contiguous or spread out through the file.
Note that you must call finish to read the offset of the
following IFD.
Implementations§
Source§impl ImageFileDirectoryReader
impl ImageFileDirectoryReader
Sourcepub async fn open<F: MetadataFetch>(
fetch: &F,
ifd_start_offset: u64,
bigtiff: bool,
endianness: Endianness,
) -> AsyncTiffResult<Self>
pub async fn open<F: MetadataFetch>( fetch: &F, ifd_start_offset: u64, bigtiff: bool, endianness: Endianness, ) -> AsyncTiffResult<Self>
Read and parse the IFD starting at the given file offset
Sourcepub async fn read_tag<F: MetadataFetch>(
&self,
fetch: &F,
tag_idx: u64,
) -> AsyncTiffResult<(Tag, TagValue)>
pub async fn read_tag<F: MetadataFetch>( &self, fetch: &F, tag_idx: u64, ) -> AsyncTiffResult<(Tag, TagValue)>
Manually read the tag with the specified index.
Panics if the tag index is out of range of the tag count.
This can be useful if you need to access tags at a low level. You’ll need to call
ImageFileDirectory::from_tags on the resulting collection of tags.
Sourcepub async fn read<F: MetadataFetch>(
&self,
fetch: &F,
) -> AsyncTiffResult<ImageFileDirectory>
pub async fn read<F: MetadataFetch>( &self, fetch: &F, ) -> AsyncTiffResult<ImageFileDirectory>
Read all tags out of this IFD.
Keep in mind that you’ll still need to call finish to get the byte offset
of the next IFD.
Sourcepub async fn finish<F: MetadataFetch>(
self,
fetch: &F,
) -> AsyncTiffResult<Option<u64>>
pub async fn finish<F: MetadataFetch>( self, fetch: &F, ) -> AsyncTiffResult<Option<u64>>
Finish this reader, reading the byte offset of the next IFD