Skip to content

Commit 355f377

Browse files
authored
Remove print and debug statements (#52)
* Suppress debug statements * Remove debug statements * Fixup * Lint
1 parent 02ce00c commit 355f377

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

src/ifd.rs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ impl ImageFileDirectory {
200200
let (tag_name, tag_value) = read_tag(cursor, bigtiff).await?;
201201
tags.insert(tag_name, tag_value);
202202
}
203-
dbg!(&tags);
204203

205204
// Tag 2 bytes
206205
// Type 2 bytes
@@ -283,7 +282,6 @@ impl ImageFileDirectory {
283282
let mut other_tags = HashMap::new();
284283

285284
tag_data.drain().try_for_each(|(tag, value)| {
286-
dbg!(&tag);
287285
match tag {
288286
Tag::NewSubfileType => new_subfile_type = Some(value.into_u32()?),
289287
Tag::ImageWidth => image_width = Some(value.into_u32()?),
@@ -297,17 +295,11 @@ impl ImageFileDirectory {
297295
PhotometricInterpretation::from_u16(value.into_u16()?)
298296
}
299297
Tag::ImageDescription => image_description = Some(value.into_string()?),
300-
Tag::StripOffsets => {
301-
dbg!(&value);
302-
strip_offsets = Some(value.into_u64_vec()?)
303-
}
298+
Tag::StripOffsets => strip_offsets = Some(value.into_u64_vec()?),
304299
Tag::Orientation => orientation = Some(value.into_u16()?),
305300
Tag::SamplesPerPixel => samples_per_pixel = Some(value.into_u16()?),
306301
Tag::RowsPerStrip => rows_per_strip = Some(value.into_u32()?),
307-
Tag::StripByteCounts => {
308-
dbg!(&value);
309-
strip_byte_counts = Some(value.into_u64_vec()?)
310-
}
302+
Tag::StripByteCounts => strip_byte_counts = Some(value.into_u64_vec()?),
311303
Tag::MinSampleValue => min_sample_value = Some(value.into_u16_vec()?),
312304
Tag::MaxSampleValue => max_sample_value = Some(value.into_u16_vec()?),
313305
Tag::XResolution => match value {
@@ -447,9 +439,6 @@ impl ImageFileDirectory {
447439
// https://web.archive.org/web/20240329145253/https://www.awaresystems.be/imaging/tiff/tifftags/planarconfiguration.html
448440
PlanarConfiguration::Chunky
449441
} else {
450-
dbg!(planar_configuration);
451-
dbg!(samples_per_pixel);
452-
println!("planar_configuration not found and samples_per_pixel not 1");
453442
PlanarConfiguration::Chunky
454443
};
455444
Ok(Self {
@@ -853,7 +842,6 @@ async fn read_tag(cursor: &mut AsyncCursor, bigtiff: bool) -> AsyncTiffResult<(T
853842
let tag_type = Type::from_u16(tag_type_code).expect(
854843
"Unknown tag type {tag_type_code}. TODO: we should skip entries with unknown tag types.",
855844
);
856-
dbg!(tag_name, tag_type);
857845
let count = if bigtiff {
858846
cursor.read_u64().await?
859847
} else {
@@ -902,7 +890,6 @@ async fn read_tag_value(
902890
// Case 2: there is one value.
903891
if count == 1 {
904892
// 2a: the value is 5-8 bytes and we're in BigTiff mode.
905-
dbg!("case 2a");
906893
if bigtiff && value_byte_length > 4 && value_byte_length <= 8 {
907894
let mut data = cursor.read(value_byte_length).await?;
908895

@@ -932,7 +919,6 @@ async fn read_tag_value(
932919
let mut data = cursor.read(value_byte_length).await?;
933920

934921
// 2b: the value is at most 4 bytes or doesn't fit in the offset field.
935-
dbg!("case 2b");
936922
return Ok(match tag_type {
937923
Type::BYTE | Type::UNDEFINED => Value::Byte(data.read_u8()?),
938924
Type::SBYTE => Value::Signed(data.read_i8()? as i32),
@@ -989,7 +975,6 @@ async fn read_tag_value(
989975

990976
// Case 3: There is more than one value, but it fits in the offset field.
991977
if value_byte_length <= 4 || bigtiff && value_byte_length <= 8 {
992-
dbg!("case 3");
993978
let mut data = cursor.read(value_byte_length).await?;
994979
if bigtiff {
995980
cursor.advance(8 - value_byte_length);
@@ -1091,7 +1076,6 @@ async fn read_tag_value(
10911076
cursor.seek(offset);
10921077

10931078
// Case 4: there is more than one value, and it doesn't fit in the offset field.
1094-
dbg!("case 4");
10951079
match tag_type {
10961080
// TODO check if this could give wrong results
10971081
// at a different endianess of file/computer.

0 commit comments

Comments
 (0)