Skip to content

Commit ce95ee3

Browse files
committed
Remove debug statements
1 parent 9a1b5b8 commit ce95ee3

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

src/ifd.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ impl ImageFileDirectory {
200200
let (tag_name, tag_value) = read_tag(cursor, bigtiff).await?;
201201
tags.insert(tag_name, tag_value);
202202
}
203-
#[cfg(debug_assertions)]
204-
println!(&tags);
205203

206204
// Tag 2 bytes
207205
// Type 2 bytes
@@ -284,8 +282,6 @@ impl ImageFileDirectory {
284282
let mut other_tags = HashMap::new();
285283

286284
tag_data.drain().try_for_each(|(tag, value)| {
287-
#[cfg(debug_assertions)]
288-
println!(&tag);
289285
match tag {
290286
Tag::NewSubfileType => new_subfile_type = Some(value.into_u32()?),
291287
Tag::ImageWidth => image_width = Some(value.into_u32()?),
@@ -300,15 +296,13 @@ impl ImageFileDirectory {
300296
}
301297
Tag::ImageDescription => image_description = Some(value.into_string()?),
302298
Tag::StripOffsets => {
303-
println!(&value);
304299
strip_offsets = Some(value.into_u64_vec()?)
305300
}
306301
Tag::Orientation => orientation = Some(value.into_u16()?),
307302
Tag::SamplesPerPixel => samples_per_pixel = Some(value.into_u16()?),
308303
Tag::RowsPerStrip => rows_per_strip = Some(value.into_u32()?),
309304
Tag::StripByteCounts => {
310305
#[cfg(debug_assertions)]
311-
println!(&value);
312306
strip_byte_counts = Some(value.into_u64_vec()?)
313307
}
314308
Tag::MinSampleValue => min_sample_value = Some(value.into_u16_vec()?),
@@ -450,11 +444,6 @@ impl ImageFileDirectory {
450444
// https://web.archive.org/web/20240329145253/https://www.awaresystems.be/imaging/tiff/tifftags/planarconfiguration.html
451445
PlanarConfiguration::Chunky
452446
} else {
453-
#[cfg(debug_assertions)]
454-
println!(planar_configuration);
455-
#[cfg(debug_assertions)]
456-
println!(samples_per_pixel);
457-
println!("planar_configuration not found and samples_per_pixel not 1");
458447
PlanarConfiguration::Chunky
459448
};
460449
Ok(Self {
@@ -858,8 +847,6 @@ async fn read_tag(cursor: &mut AsyncCursor, bigtiff: bool) -> AsyncTiffResult<(T
858847
let tag_type = Type::from_u16(tag_type_code).expect(
859848
"Unknown tag type {tag_type_code}. TODO: we should skip entries with unknown tag types.",
860849
);
861-
#[cfg(debug_assertions)]
862-
println!(tag_name, tag_type);
863850
let count = if bigtiff {
864851
cursor.read_u64().await?
865852
} else {
@@ -908,8 +895,6 @@ async fn read_tag_value(
908895
// Case 2: there is one value.
909896
if count == 1 {
910897
// 2a: the value is 5-8 bytes and we're in BigTiff mode.
911-
#[cfg(debug_assertions)]
912-
println!("case 2a");
913898
if bigtiff && value_byte_length > 4 && value_byte_length <= 8 {
914899
let mut data = cursor.read(value_byte_length).await?;
915900

@@ -939,8 +924,6 @@ async fn read_tag_value(
939924
let mut data = cursor.read(value_byte_length).await?;
940925

941926
// 2b: the value is at most 4 bytes or doesn't fit in the offset field.
942-
#[cfg(debug_assertions)]
943-
println!("case 2b");
944927
return Ok(match tag_type {
945928
Type::BYTE | Type::UNDEFINED => Value::Byte(data.read_u8()?),
946929
Type::SBYTE => Value::Signed(data.read_i8()? as i32),
@@ -997,8 +980,6 @@ async fn read_tag_value(
997980

998981
// Case 3: There is more than one value, but it fits in the offset field.
999982
if value_byte_length <= 4 || bigtiff && value_byte_length <= 8 {
1000-
#[cfg(debug_assertions)]
1001-
println!("case 3");
1002983
let mut data = cursor.read(value_byte_length).await?;
1003984
if bigtiff {
1004985
cursor.advance(8 - value_byte_length);
@@ -1100,8 +1081,6 @@ async fn read_tag_value(
11001081
cursor.seek(offset);
11011082

11021083
// Case 4: there is more than one value, and it doesn't fit in the offset field.
1103-
#[cfg(debug_assertions)]
1104-
println!("case 4");
11051084
match tag_type {
11061085
// TODO check if this could give wrong results
11071086
// at a different endianess of file/computer.

0 commit comments

Comments
 (0)