Skip to content

Commit

Permalink
Simply implementation of 'tag_iter()'
Browse files Browse the repository at this point in the history
  • Loading branch information
gschulze committed Nov 24, 2024
1 parent 395a755 commit e4c1fd2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 66 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ categories = ["multimedia::images", "multimedia::encoding"]
exclude = ["tests/images/*", "tests/fuzz_images/*"]

[dependencies]
either = "1.13.0"
weezl = "0.1.0"
jpeg = { package = "jpeg-decoder", version = "0.3.0", default-features = false }
flate2 = "1.0.20"
Expand Down
18 changes: 5 additions & 13 deletions src/decoder/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use std::collections::{HashMap, HashSet};
use std::io::{self, Read, Seek};

use either::Either;

use crate::decoder::tag_iter::TagIter;
use crate::tags::{
CompressionMethod, PhotometricInterpretation, PlanarConfiguration, Predictor, SampleFormat,
Tag, Type,
Expand All @@ -19,7 +16,6 @@ use self::stream::{ByteOrder, EndianReader, SmartReader};
pub mod ifd;
mod image;
mod stream;
mod tag_iter;
mod tag_reader;

/// Result of a decoding process
Expand Down Expand Up @@ -899,15 +895,11 @@ impl<R: Read + Seek> Decoder<R> {
}

pub fn tag_iter(&mut self) -> impl Iterator<Item = TiffResult<(Tag, ifd::Value)>> + '_ {
match self.image().ifd.as_ref() {
None => Either::Left(std::iter::empty()),
Some(ifd) => Either::Right(TagIter::new(
ifd.clone(),
&self.limits,
self.bigtiff,
&mut self.reader,
)),
}
self.image.ifd.as_ref().unwrap().iter().map(|(tag, entry)| {
entry
.val(&self.limits, self.bigtiff, &mut self.reader)
.map(|value| (*tag, value))
})
}

fn check_chunk_type(&self, expected: ChunkType) -> TiffResult<()> {
Expand Down
52 changes: 0 additions & 52 deletions src/decoder/tag_iter.rs

This file was deleted.

0 comments on commit e4c1fd2

Please sign in to comment.