From 611b8f0372d18d937a11d25070e9d4023ce06543 Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Sat, 26 Nov 2016 15:51:09 +0100 Subject: merge-hdr-batch --- merge-hdr-batch | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 merge-hdr-batch (limited to 'merge-hdr-batch') diff --git a/merge-hdr-batch b/merge-hdr-batch new file mode 100755 index 0000000..3cad1b1 --- /dev/null +++ b/merge-hdr-batch @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby + +BILDROEHRE=File.dirname(__FILE__) +DIR=ARGV[0] +TONEMAP=ARGV[1] +GAMMA=ARGV[2].to_f +i = 0 +while line = STDIN.gets + fs = line.strip.split + s = " -f #{DIR}" + args = fs.join (" -f #{DIR}") + 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}" + } + 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}" + STDERR.write "#{cmd}\n" + `#{cmd}` + i += 1 +end + -- cgit v1.2.3