-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscan
More file actions
executable file
·26 lines (21 loc) · 739 Bytes
/
scan
File metadata and controls
executable file
·26 lines (21 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
# see with scanimage -L
if [ $# -eq 0 ]
then
echo "scan image_name [print_device_name]"
echo "'scanimage -L' to get a list of devices"
fi
if [ $# -eq 1 ]
then
echo "Try to get device…"
device=$(scanimage -L | tail -1 | grep -oP "(?<=\`).[^']*")
echo "scanimage -p --device $device --resolution 1200dpi --mode Color --format=jpeg > $1.jpeg"
scanimage -p --device "$device" --resolution 1200dpi --mode Color --format=jpeg > "$1.jpeg"
fi
if [ $# -eq 2 ]
then
echo "scanimage -p --device $2 --resolution 1200dpi --mode Color --format=jpeg > $1.jpeg"
scanimage -p --device "$2" --resolution 1200dpi --mode Color --format=jpeg > "$1.jpeg"
fi
# convert "$1.tiff" "$1.jpg"
# rm "$1.tiff"