You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got samples with values between 0 and 255, i.e. the bits were combined into bytes and then written out as byte values in decimal.
P1
24 7
0 0 0
121 231 158
etc.
Reproduction steps
let f = File::create("pic.pbm")?;
let mut writer = BufWriter::new(f);
let encoder =
PnmEncoder::new(&mut writer).with_subtype(PnmSubtype::Bitmap(SampleEncoding::Ascii));
imgbuf.write_with_encoder(encoder)?;
P.S. If you can point me in the right direction, I'm happy to send a PR to address this.
The text was updated successfully, but these errors were encountered:
Encoding a PNM bitmap as binary (type P4) works correctly, but encoding it as ASCII (type P1) results in the wrong sample format.
Specification: https://netpbm.sourceforge.net/doc/pbm.html
Expected
I expected a file with samples of 1s and 0s.
NOTE: The spaces are optional.
Actual behaviour
I got samples with values between 0 and 255, i.e. the bits were combined into bytes and then written out as byte values in decimal.
Reproduction steps
P.S. If you can point me in the right direction, I'm happy to send a PR to address this.
The text was updated successfully, but these errors were encountered: