warn on deskew but no crop

Best practices from the sane mailing list indicate that deskew should
be used in combination with crop for best results. Warn if not doing
so.
This commit is contained in:
Raman Gupta 2023-04-19 12:46:49 -04:00
parent 31ef706c47
commit eea2c495d9

11
scan
View File

@ -258,6 +258,13 @@ case "$SIZE" in
esac
if [[ $DESKEW == 1 ]]; then
if [[ $CROP != 1 ]]; then
echo >&2 'Warning: `--deskew` specified, but `--crop` not specified. It is recommended to scan at max height/width and then crop to give deskew the best chance of working correctly.'
fi
DESKEW="--swdeskew=yes"
fi
if [[ $CROP != 1 && "$PGHEIGHT" != "" ]]; then
PGHEIGHTIN=$(units --compact -1 "$PGHEIGHT mm" 'in')
PGHEIGHT="--page-height $PGHEIGHT -y $PGHEIGHT"
@ -279,10 +286,6 @@ if [[ $CROP == 1 ]]; then
PS2PDF_OPTS="-dEPSCrop"
fi
if [[ $DESKEW == 1 ]]; then
DESKEW="--swdeskew=yes"
fi
if [[ $SKIP_EMPTY_PAGES == 1 && ! -x "$(command -v bc)" ]]; then
echo >&2 'Warning: `--skip-empty-pages` specified, but `bc` not available. Disabling empty page detection.'
SKIP_EMPTY_PAGES=0