JPEG compression improves scan time, and some scanners require it
for high DPI values. But it loses some data, and we already support
toggling it at compile-time.
Add an advanced option so users can decide at scan-time.
Do not decode JPEG into output buffer if it's NULL.
Also, I add assert() for `dev->decData` size, which is never
checked anywhere. Thanks to Michal Nowak for report and
testing. Fixes#128.
References:
https://gitlab.com/sane-project/backends/issues/128
Tested-by: Michal Nowak <Mno-hime@gitlab>
Patch is submitted by Laxmeesh Onkar Markod <m.laxmeesh@samsung.com>
Patch to code is applied almost verbatim, except, insignificant
formatting fixes and making new functions static.
Also, new USB ids added and scanner support is changed as reported.