diff --git a/scan b/scan index c23dad2..f2246da 100755 --- a/scan +++ b/scan @@ -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