annotate plugins/ufraw/geeqie-ufraw @ 1674:d5c921f9bb4c

Fix a overrun data_offset + data_length could be bigger than guint which makes the calculation overflow to a value smaller then size.
author mow
date Sat, 18 Jul 2009 08:16:54 +0000
parents 65ebc00c3780
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
1 #!/bin/bash
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
2
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
3 # FIXME TODO:
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
4 # improve the default ufraw configuration
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
5 # localization?
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
6
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
7
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
8 # matches raw file names, used as case insensitive
1646
70277ff12cfc fixed regexp usage
nadvornik
parents: 1645
diff changeset
9 RAW_REGEX='.*\.(arw|srf|sr2|crw|cr2|kdc|dcr|k25|raf|mef|mos|mrw|nef|orf|pef|ptx|dng|x3f|raw|r3d|3fr|erf)$'
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
10
1651
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
11 # matches output file names, used as case insensitive
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
12 OUT_REGEX='.*\.(jpg|jpeg|png|tif|tiff|ppm)$'
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
13
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
14 # matches ufraw id file names, used as case sensitive
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
15 ID_REGEX='.*\.ufraw$'
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
16
1651
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
17 # matches xmp sidecar file names, used as case insensitive
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
18 XMP_REGEX='.*\.xmp$'
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
19
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
20 # extract output file from ufraw id file
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
21 get_output_from_id ()
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
22 {
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
23 grep "<OutputFilename>.*</OutputFilename>" "$1" |sed -e 's|.*<OutputFilename>\(.*\)</OutputFilename>.*|\1|'
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
24 }
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
25
1651
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
26 # extract input file from ufraw id file
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
27 get_input_from_id ()
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
28 {
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
29 grep "<InputFilename>.*</InputFilename>" "$1" |sed -e 's|.*<InputFilename>\(.*\)</InputFilename>.*|\1|'
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
30 }
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
31
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
32 add_xmp_from_sidecar ()
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
33 {
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
34 idfile=$1
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
35 input=`get_input_from_id "$idfile"`
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
36 [ -f "$input" ] || return 1
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
37
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
38 basename=${input%.*}
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
39 dirname=${basename%/*}
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
40 xmp=`find "$dirname" -maxdepth 1 -path "$basename.*" -regextype posix-egrep -iregex "$XMP_REGEX" -print | head -n 1`
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
41 [ -f "$xmp" ] || return 1
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
42
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
43 output=`get_output_from_id "$idfile"`
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
44
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
45 [ -f "$output" ] || return 1
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
46 xmpext=.${xmp##*.}
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
47
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
48 # passing the source file to exiv2 is unnecessary complicated
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
49 # do not change the orientation, ufraw resets it to 1
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
50 exiv2 insert -ixX -l "$dirname" -S "$xmpext" "$output"
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
51 exiv2 -M "set Xmp.tiff.Orientation 1" "$output"
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
52 }
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
53
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
54 # test if the id file has changed and the output needs to be refreshed
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
55 id_file_changed ()
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
56 {
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
57 idfile=$1
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
58 output=`get_output_from_id "$idfile"`
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
59 [ ! -f "$output" -o "$idfile" -nt "$output" ]
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
60 }
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
61
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
62 # refresh the output file specified by given id file, if necessary
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
63 process_ufraw_id_file ()
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
64 {
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
65 idfile=$1
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
66 if id_file_changed "$idfile" ; then
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
67 ufraw-batch --overwrite "$idfile"
1651
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
68 add_xmp_from_sidecar "$idfile"
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
69 fi
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
70 }
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
71
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
72 # test for newly added raw files that were never processed
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
73 raw_file_not_processed ()
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
74 {
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
75 rawfile=$1
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
76 basename=${rawfile%.*}
1651
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
77 dirname=${basename%/*}
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
78 outfiles=`find "$dirname" -maxdepth 1 -path "$basename.*" -regextype posix-egrep \( -iregex "$OUT_REGEX" -o -regex "$ID_REGEX" \) -print `
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
79 [ -z "$outfiles" ] # return true if no possible output file exists
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
80
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
81 # raw+jpeg pair created by the camera is considered processed,
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
82 # - this function returns false, the jpeg from camera is preserved and id file is not created
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
83 }
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
84
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
85 # process raw file for the first time
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
86 process_raw_file_default ()
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
87 {
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
88 rawfile=$1
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
89 if raw_file_not_processed "$rawfile" ; then
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
90 ufraw-batch --create-id=also \
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
91 --wb=camera \
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
92 --exposure=auto \
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
93 --out-type=jpeg \
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
94 --compression=96 \
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
95 "$rawfile"
1651
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
96 idfile=${rawfile%.*}.ufraw
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
97 add_xmp_from_sidecar "$idfile"
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
98 fi
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
99 }
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
100
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
101 # process all files listed in file $1
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
102 # if $2 is not empty, produce output for zenity --progress
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
103 process_list ()
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
104 {
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
105 list=$1
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
106 use_zenity=$2
1651
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
107
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
108 count=`wc -l <$list`
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
109 n=0
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
110 [ -n "$use_zenity" ] && echo 0
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
111
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
112 if [ "$count" -gt 0 ] ; then
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
113 while read file; do
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
114 [ -f "$file" ] || continue
1646
70277ff12cfc fixed regexp usage
nadvornik
parents: 1645
diff changeset
115 if echo "$file"|grep -E -q -i "$RAW_REGEX" ; then
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
116 process_raw_file_default "$file"
1646
70277ff12cfc fixed regexp usage
nadvornik
parents: 1645
diff changeset
117 elif echo "$file"|grep -E -q "$ID_REGEX" ; then
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
118 process_ufraw_id_file "$file"
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
119
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
120 fi
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
121
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
122 n=$((n + 1))
1651
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
123
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
124 # the function can end at the 'echo' command with broken pipe
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
125 # if it is cancelled via zenity
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
126 [ -n "$use_zenity" ] && echo $((n * 100 / count))
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
127
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
128 done <$list
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
129 fi
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
130 [ -n "$use_zenity" ] && echo 100
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
131 }
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
132
1651
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
133 # process all files in directories $@, including subdirectories
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
134 # processing is controlled by zenity dialogs if $DISPLAY is set
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
135 process_tree ()
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
136 {
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
137 list=`mktemp /tmp/geeqie-ufraw-list.XXXXXXXXXX` || exit 1
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
138
1651
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
139 find "$@" -regextype posix-egrep -iregex "$RAW_REGEX" -print | while read rawfile ; do
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
140 raw_file_not_processed "$rawfile" && echo "$rawfile"
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
141 done >>$list
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
142
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
143 #refresh output from changed id files
1651
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
144 find "$@" -regextype posix-egrep -regex "$ID_REGEX" -print | while read idfile ; do
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
145 id_file_changed "$idfile" && echo "$idfile"
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
146 done >>$list
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
147
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
148 if [ -n "$DISPLAY" ] ; then
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
149 if [ -s $list ] && \
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
150 zenity --list --title "Files to proceed" --text "Files to proceed" --column "Files" <$list ; then
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
151 process_list $list with_zenity | zenity --progress --auto-close
1651
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
152 else
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
153 zenity --info --title "All files are up-to-date" --text "All files are up-to-date"
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
154 fi
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
155 else
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
156 # no DISPLAY
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
157 process_list $list
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
158 fi
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
159 rm $list
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
160 }
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
161
1651
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
162 print_help ()
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
163 {
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
164 cat << EOT
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
165
1651
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
166 RAW file collection maintenance tool
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
167
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
168 Usage:
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
169
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
170 geeqie-ufraw [raw file | id file] ...
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
171 geeqie-ufraw --recursive [dir] ...
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
172 geeqie-ufraw -h | --help
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
173
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
174 This script searches for new RAW files or for modified UFRaw
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
175 ID files and process them with ufraw-batch. It can work either
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
176 on individual files or on whole directory.
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
177 The functions are designed to be usable from Geeqie menu.
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
178
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
179 EOT
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
180 }
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
181
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
182 #parse commandline
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
183
1651
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
184 while true ; do
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
185 case "$1" in
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
186 -v|--verbose)
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
187 verbose=yes #fixme: not used yet
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
188 shift ;;
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
189 -R|--recursive)
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
190 recursive=yes
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
191 shift ;;
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
192 -h|-help|--help|-*)
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
193 print_help
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
194 exit ;;
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
195 *)
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
196 break ;;
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
197 esac
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
198 done
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
199
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
200 if [ $# -lt 1 ] ; then
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
201 print_help
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
202 exit
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
203 fi
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
204
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
205 if [ -n "$recursive" ] ; then
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
206 # recursive processing of directories
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
207 process_tree "$@"
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
208 else
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
209 list=`mktemp /tmp/geeqie-ufraw-list.XXXXXXXXXX` || exit 1
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
210 for file in "$@" ; do
1651
65ebc00c3780 various geeqie-ufraw improvements
nadvornik
parents: 1646
diff changeset
211 echo "$file" |sed -e "s|^\([^/]\)|$PWD/\1|"
1645
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
212 done >>$list
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
213 process_list $list
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
214 rm $list
8efd65465de5 ufraw-batch script
nadvornik
parents:
diff changeset
215 fi