diff --git a/src/ifd.rs b/src/ifd.rs index e9f90df..5f58d0d 100644 --- a/src/ifd.rs +++ b/src/ifd.rs @@ -200,7 +200,6 @@ impl ImageFileDirectory { let (tag_name, tag_value) = read_tag(cursor, bigtiff).await?; tags.insert(tag_name, tag_value); } - dbg!(&tags); // Tag 2 bytes // Type 2 bytes @@ -283,7 +282,6 @@ impl ImageFileDirectory { let mut other_tags = HashMap::new(); tag_data.drain().try_for_each(|(tag, value)| { - dbg!(&tag); match tag { Tag::NewSubfileType => new_subfile_type = Some(value.into_u32()?), Tag::ImageWidth => image_width = Some(value.into_u32()?), @@ -297,17 +295,11 @@ impl ImageFileDirectory { PhotometricInterpretation::from_u16(value.into_u16()?) } Tag::ImageDescription => image_description = Some(value.into_string()?), - Tag::StripOffsets => { - dbg!(&value); - strip_offsets = Some(value.into_u64_vec()?) - } + Tag::StripOffsets => strip_offsets = Some(value.into_u64_vec()?), Tag::Orientation => orientation = Some(value.into_u16()?), Tag::SamplesPerPixel => samples_per_pixel = Some(value.into_u16()?), Tag::RowsPerStrip => rows_per_strip = Some(value.into_u32()?), - Tag::StripByteCounts => { - dbg!(&value); - strip_byte_counts = Some(value.into_u64_vec()?) - } + Tag::StripByteCounts => strip_byte_counts = Some(value.into_u64_vec()?), Tag::MinSampleValue => min_sample_value = Some(value.into_u16_vec()?), Tag::MaxSampleValue => max_sample_value = Some(value.into_u16_vec()?), Tag::XResolution => match value { @@ -447,9 +439,6 @@ impl ImageFileDirectory { // https://web.archive.org/web/20240329145253/https://www.awaresystems.be/imaging/tiff/tifftags/planarconfiguration.html PlanarConfiguration::Chunky } else { - dbg!(planar_configuration); - dbg!(samples_per_pixel); - println!("planar_configuration not found and samples_per_pixel not 1"); PlanarConfiguration::Chunky }; Ok(Self { @@ -853,7 +842,6 @@ async fn read_tag(cursor: &mut AsyncCursor, bigtiff: bool) -> AsyncTiffResult<(T let tag_type = Type::from_u16(tag_type_code).expect( "Unknown tag type {tag_type_code}. TODO: we should skip entries with unknown tag types.", ); - dbg!(tag_name, tag_type); let count = if bigtiff { cursor.read_u64().await? } else { @@ -902,7 +890,6 @@ async fn read_tag_value( // Case 2: there is one value. if count == 1 { // 2a: the value is 5-8 bytes and we're in BigTiff mode. - dbg!("case 2a"); if bigtiff && value_byte_length > 4 && value_byte_length <= 8 { let mut data = cursor.read(value_byte_length).await?; @@ -932,7 +919,6 @@ async fn read_tag_value( let mut data = cursor.read(value_byte_length).await?; // 2b: the value is at most 4 bytes or doesn't fit in the offset field. - dbg!("case 2b"); return Ok(match tag_type { Type::BYTE | Type::UNDEFINED => Value::Byte(data.read_u8()?), Type::SBYTE => Value::Signed(data.read_i8()? as i32), @@ -989,7 +975,6 @@ async fn read_tag_value( // Case 3: There is more than one value, but it fits in the offset field. if value_byte_length <= 4 || bigtiff && value_byte_length <= 8 { - dbg!("case 3"); let mut data = cursor.read(value_byte_length).await?; if bigtiff { cursor.advance(8 - value_byte_length); @@ -1091,7 +1076,6 @@ async fn read_tag_value( cursor.seek(offset); // Case 4: there is more than one value, and it doesn't fit in the offset field. - dbg!("case 4"); match tag_type { // TODO check if this could give wrong results // at a different endianess of file/computer.