>>>>> "rob" == rob  <[EMAIL PROTECTED]> writes:


    rob> I'm trying to catalog my photos I've got a negative scanner
    rob> which scans them in 12 twelve at a time (epson 2450 photo) is
    rob> there a script I can run it through to get 12 individual
    rob> images?

I'm attaching an undocumented script I use to scan film and slides
with my epson 2450 using scanimage.  Here's how I used it this morning
to scan a set of 12 images while I was commuting to work.

( for x in 1 2 3 4 5 6 7 8 9 10 11 12; do F=$((x+3)); scanfilm --strip $x --file 
$(printf "f%02d.tif" $F) --format tiff --resolution 2400 --depth 16; done) > scan.log 
2>&1 &


And here is a scan from a couple days ago when I had uncut slide film:

( for x in 3 4 8 9 10; do F=$((x+2)); scanfilm --strip $x --positive --file $(printf 
"%02d.tif" $F) --format tiff --resolution 2400 --depth 16; done) > scan.log 2>&

    o The --strip uses the 35-mm strip holder and assumes negative film.
    o The --slide uses the 35-mm (mounted) slide holder and assumes
      positive film.
    o The film type may be overridden via --positive or --negative.
    o Unrecognized options are passes through as-is (e.g.,
      --resolution, --depth, --format).  No promises that it won't
      break on somthing.

Note that I don't have anything set up for medium format film yet.  I
have a roll I need to scan, so I'll probably add that in the next week
or so.

roland
-- 
                       PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD                             RL Enterprises
[EMAIL PROTECTED]                     76-15 113th Street, Apt 3B
[EMAIL PROTECTED]                       Forest Hills, NY 11375

#! /bin/bash
#
# Copyright  2002, Roland Roberts <[EMAIL PROTECTED]>
#
# RCS Revision
#   @(#) $Id$
#   $Source$
#
# Helper script for scanning film (negative/slide) from Epson
# Perfection 2450 Photo scanner.
#
#
# TODO:
#   --resolution, --brightness, --mode, --depth
#   Ideally, anything unrecognized should pass through.
#
negative=-1
slot=1


ARGS=
while [ $# -gt 0 ]; do
    case "$1" in
        
        --rotate)
            shift
            rotate="$1"
            if [ $rotate -eq 90 ]; then
                rotate=-r90
            elif [ $rotate -eq 270 ]; then
                rotate=-r270
            elif [ $rotate -eq 180 ]; then
                rotate=-r180
            else
                echo "invalid rotation: $rotate; select --rotate 90|180|270" >&2
                exit 1
            fi
            ;;

        --file)
            shift
            file="$1"
            ;;

        --positive)
            negative=0
            ;;
        
        --negative)
            negative=1
            ;;
        
        --strip)
            if [ $negative -lt 0 ]; then
                negative=1
            fi
            shift
            slot="$1"
            if [ x$file = x ]; then
                file=$(printf "%02d" $slot).pnm
            fi
            left=7
            if [ $slot -gt 6 ]; then
                slot=$((slot-6))
                left=70
            fi
            if [ $slot -gt 6 ]; then
                echo '--slot out of range 1-12' >&2
                exit 1
            fi
            top=$(echo "2.5+38*($slot-1)" | bc -l)
            ;;
        
        --slide)
            if [ $negative -lt 0 ]; then
                negative=0
            fi
            shift
            slot="$1"
            if [ x$file = x ]; then
                file=$(printf "%02d" $slot).pnm
            fi
            left=38
            if [ $slot -gt 4 ]; then
                echo '--slot out of range 1-4' >&2
                exit 1
            fi
            # FIXME: What is the correct value for `top'?
            top=$((9+58*($slot-1)))

            ;;

        *)
            ARGS="$ARGS $1"
            ;;
    esac
    shift
done

if [ $negative -gt 0 ]; then
    film_type='Negative Film'
else
    film_type='Positive Film'
fi

CMD="scanimage -d epson:/dev/usbscanner0 --focus-position 'Focus 2.5mm above glass' 
--source 'Transparency Unit' --mode color --film-type $film_type --resolution 1200 
--brightness 3 -x 26mm -y 38mm -l ${left}mm -t ${top}mm --depth 8 $ARGS"
if [ x$rotate != x ]; then
    CMD="$CMD | pnmflip $rotate > $file"
else 
    CMD="$CMD > $file"
fi
echo "$CMD"
eval "$CMD"


Reply via email to