Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenjudkins committed Apr 8, 2024
1 parent f475d6d commit fbe26e9
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/decoder/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,17 @@ impl Image {
// all extant tiff/fax4 decoders I've found always assume that the photometric interpretation
// is `WhiteIsZero`, ignoring the tag. ImageMagick appears to generate fax4-encoded tiffs
// with the tag incorrectly set to `BlackIsZero`.
fax::decoder::decode_g4(reader.bytes().map(|b| b.unwrap() ), width, Some(height), |transitions| {
out.extend(fax::decoder::pels(transitions, width).map(|c| match c {
fax::Color::Black => 255,
fax::Color::White => 0,
}))
});
fax::decoder::decode_g4(
reader.bytes().map(|b| b.unwrap()),
width,
Some(height),
|transitions| {
out.extend(fax::decoder::pels(transitions, width).map(|c| match c {
fax::Color::Black => 255,
fax::Color::White => 0,
}))
},
);
Box::new(Cursor::new(out))
}
method => {
Expand Down

0 comments on commit fbe26e9

Please sign in to comment.