summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2016-12-01 09:03:59 +0100
committerPatrick Simianer <p@simianer.de>2016-12-01 09:03:59 +0100
commit8599f3cb6a36e207e5fa0365f75c6f4333f6d641 (patch)
tree491d50a9d4afc1d6e17a524569659e3c15bfe240
parent611b8f0372d18d937a11d25070e9d4023ce06543 (diff)
merge-hdr-batch: use exiftool
-rwxr-xr-xmerge-hdr-batch12
1 files changed, 10 insertions, 2 deletions
diff --git a/merge-hdr-batch b/merge-hdr-batch
index 3cad1b1..eadd33c 100755
--- a/merge-hdr-batch
+++ b/merge-hdr-batch
@@ -9,10 +9,18 @@ while line = STDIN.gets
fs = line.strip.split
s = " -f #{DIR}"
args = fs.join (" -f #{DIR}")
+ skip = false
fs.each { |f|
- exposure = `exiv2 #{DIR}/#{f} 2>/dev/null | grep 'Exposure time' | cut -d ':' -f 2 | strips | cut -d " " -f 1`
- args += " -w #{Rational(exposure).to_f}"
+ exposure = `exiftool #{DIR}/#{f} 2>/dev/null | grep 'Shutter Speed Value' | cut -d ':' -f 2 | strips`
+ begin
+ args += " -w #{Rational(exposure).to_f}"
+ rescue
+ STDERR.write "Error, can't get exposure! Skipping #{line}."
+ skip = true
+ break
+ end
}
+ next if skip
is = i.to_s.rjust(3, "0")
s += args
cmd = "#{BILDROEHRE}/merge -D -R -g 1.0 -O debevec-#{TONEMAP}-gamma#{GAMMA}-#{is}.jpg -p robertston-#{TONEMAP}-gamma#{GAMMA}-#{is}.jpg #{s}"