Skip to content

Commit bb5f564

Browse files
committed
feat(ccitt): fix second Decoder
1 parent c52969e commit bb5f564

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

crates/ccitt/examples/tiffdecode.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{
55

66
use ccitt_t4_t6::{
77
bits::{BitWriter, FillOrder},
8-
g42d::{fax_decode, G4Decoder, FaxOptions},
8+
g42d::{fax_decode, FaxOptions, G4Decoder},
99
};
1010
use color_eyre::eyre::{self, eyre};
1111
use tiff::{
@@ -149,14 +149,19 @@ fn main() -> eyre::Result<()> {
149149

150150
println!("DONE fax_decode");
151151
let mut decoder = G4Decoder::<BitWriter>::new(width.into());
152+
decoder.set_fill_order(fill_order);
152153
decoder.decode(&bytes)?;
153154
let store = decoder.into_store();
154155

155156
let bitmap = store.done();
157+
println!("DONE G4Decoder");
156158

157-
let mut string = String::new();
158-
ccitt_t4_t6::ascii_art(&mut string, &bitmap, width as usize, opt.invert).unwrap();
159-
print!("{}", string);
159+
if opt.print {
160+
let mut string = String::new();
161+
ccitt_t4_t6::ascii_art(&mut string, &bitmap, width as usize, opt.invert)
162+
.unwrap();
163+
print!("{}", string);
164+
}
160165
}
161166
Ok(())
162167
}

0 commit comments

Comments
 (0)