If value for bytes_per_line is not reasonable in 1 bit per pixel mode, calculate a new value. The sane backend for the HP Officejet Pro 8600 N911a printer/scanner is has the bug that it specified a wrong value for the number of bytes per scan line in lineart mode (1 bit per pixel). Debugging seems to indicate that the faulty value is coming from the firmware of that 11 years old printer/scanner device. Some Sane frontends ignore the bytes_per_line values. This who use it do not work with that device, notable when scanning with Libreoffice Writer. So the problem is obviously caused by the sane backend, not by the sane.ds code. This merge requests offers a workaround by calculating a new value from the scan width in pixels if the given value is not plausible. This makes scanning in LineArt mode possible for that device. It is unclear if any other devices are also effected. It is unclear if the wine project wants to add workrounds like this to the code base, so I see it as a proposal for a discussion. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9673