Refactor directory reading
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.
This commit is contained in:
1 parent
6275b7a36d
commit
98cd3dc2d2
3 files changed
+398
-271
No files matched your search
@@ -18,7 +18,7 @@ pub struct EndianReader<R> {
|
||||
pub(crate) byte_order: ByteOrder,
|
||||
}
|
||||
|
||||
impl<R: Read + Seek> EndianReader<R> {
|
||||
impl<R: Read> EndianReader<R> {
|
||||
pub fn new(reader: R, byte_order: ByteOrder) -> Self {
|
||||
Self { reader, byte_order }
|
||||
}
|
||||
@@ -27,7 +27,10 @@ impl<R: Read + Seek> EndianReader<R> {
|
||||
&mut self.reader
|
||||
}
|
||||
|
||||
pub fn goto_offset(&mut self, offset: u64) -> io::Result<()> {
|
||||
pub fn goto_offset(&mut self, offset: u64) -> io::Result<()>
|
||||
where
|
||||
R: Seek,
|
||||
{
|
||||
self.reader.seek(io::SeekFrom::Start(offset))?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user