tAdd filmscan wrapper for scanimage(1) - filmtools - various tools for photographic film development and darkroom printing
 (HTM) git clone git://src.adamsgaard.dk/filmtools
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
 (DIR) commit 951a2984fe084e232f65e27f281fdd728ff21b69
 (DIR) parent d71e61199762df0226f33140f7259a2e6f34a46f
 (HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
       Date:   Thu,  2 Apr 2020 19:28:24 +0200
       
       Add filmscan wrapper for scanimage(1)
       
       Diffstat:
         M Makefile                            |       6 +++---
         A filmscan                            |      20 ++++++++++++++++++++
         A filmscan.1                          |      24 ++++++++++++++++++++++++
       
       3 files changed, 47 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/Makefile b/Makefile
       t@@ -3,8 +3,8 @@
        include config.mk
        
        SRC = timeadj.c
       -BIN = timeadj
       -MAN1 = timeadj.1
       +BIN = timeadj filmscan
       +MAN1 = timeadj.1 filmscan.1
        
        OBJ = ${SRC:.c=.o}
        
       t@@ -24,7 +24,7 @@ install: all
                cp -f ${BIN} ${DESTDIR}${PREFIX}/bin
                for f in ${BIN}; do chmod 755 ${DESTDIR}${PREFIX}/bin/$$f; done
                mkdir -p ${DESTDIR}${MANPREFIX}/man1
       -        cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1
       +        cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1/
                for m in ${MAN1}; do chmod 644 ${DESTDIR}${MANPREFIX}/man1/$$m; done
        
        uninstall:
 (DIR) diff --git a/filmscan b/filmscan
       t@@ -0,0 +1,20 @@
       +#!/bin/sh
       +# requirements: scanimage(1) from sane-backends
       +
       +n=0
       +basename="$(date +%Y-%m-%d-filmscan-)"
       +ext="tiff"
       +
       +while :; do
       +        f="${basename}$(printf '%05d' "$n").${ext}"
       +        [ ! -f "$f" ] && break
       +        n=$(( n + 1 )) 
       +        if [ $n -gt 9999 ]; then
       +                echo "error: file name counter value exceeded" >&2
       +                exit 1
       +        fi
       +done
       +
       +echo "$f"
       +
       +scanimage --mode Lineart --format=tiff > "$f"
 (DIR) diff --git a/filmscan.1 b/filmscan.1
       t@@ -0,0 +1,24 @@
       +.Dd Jan 12, 2020
       +.Dt FILMSCAN 1
       +.Os
       +.Sh NAME
       +.Nm filmscan
       +.Nd film scanning tool
       +.Sh SYNOPSIS
       +.Nm
       +.Sh DESCRIPTION
       +.Nm
       +is a wrapper for
       +.Xr scanimage 1
       +from sane-backends.
       +Scanned images are saved as tiff images in the current directory
       +with a naming scheme that does not overwrite prior scans.
       +.Pp
       +The output format is the following:
       +.Pp
       +.Dl YYYY-MM-DD-filmscan-NNNNN
       +.Pp
       +where YYYY, MM, DD is the current year, month, and date, and NNNNN
       +is a five-digit counter starting with 00000.
       +.Sh AUTHORS
       +.An Anders Damsgaard Aq Mt anders@adamsgaard.dk