sbs20 / scanservjs

SANE scanner nodejs web ui
https://sbs20.github.io/scanservjs/
GNU General Public License v2.0
766 stars 145 forks source link

Fix `--batch=format` argument #658

Closed sbs20 closed 1 year ago

sbs20 commented 1 year ago

The scanimage --batcn=format argument is unusual (for scanimage) in that it requires an = in it. The previous argument escaping does not play well, however. Without this change the resultant arguments end up looking like this:

scanimage -d deviceId .... '--batch=img%01d.jpg'

Which scanimage fails to parse well, which in turn causes scans to break.

This commit adds a special method for escaping argument pairs correctly.

Also adds unit test coverage.