Open timboldt opened 4 months ago
The relevant code is in https://github.com/image-rs/image/blob/main/src/codecs/pnm/encoder.rs
The easiest thing might be to either step through it with a debugger or add some println! calls to see which code path is being taken
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.