#!/bin/bash

set -euo pipefail

OUTFILE=$(mktemp -d)

scanimage --source 'ADF Duplex' --format tiff --mode Color --brightness 23 --resolution 300 --page-width 210 --page-height 297.3 -x 210 -y 297.3 --batch=${OUTFILE}/p%04d.tiff

/etc/scanbd/scripts/ocr.sh "$OUTFILE" &