From: Colin D B. <cbe...@us...> - 2006-06-26 16:40:23
|
Update of /cvsroot/ufraw/ufraw In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26773 Modified Files: wb_extract.pl Log Message: Added support in wb_extract.pl for D70 white balance values, which are in different Exif fields than the D200. Index: wb_extract.pl =================================================================== RCS file: /cvsroot/ufraw/ufraw/wb_extract.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wb_extract.pl 25 Jun 2006 23:38:30 -0000 1.1 --- wb_extract.pl 26 Jun 2006 16:40:17 -0000 1.2 *************** *** 13,19 **** for my $file (@ARGV) { ! my ($make, $model, $wbname, $wbfinetune, $mul1, $mul2, $mul3); ! open(EXIFTOOL, "exiftool -s -t -Model -ColorBalance1 -WhiteBalance -WhiteBalanceFineTune $file|") or die "can't open $file: $!"; while (my $line = <EXIFTOOL>) { --- 13,21 ---- for my $file (@ARGV) { ! my ($make, $model, $wbname, $wbfinetune, $mulred, $mulgreen, $mulblue); ! $mulgreen = 1; # default value for green balance ! ! open(EXIFTOOL, "exiftool -s -t -Model -ColorBalance1 -RedBalance -BlueBalance -WhiteBalance -WhiteBalanceFineTune $file|") or die "can't open $file: $!"; while (my $line = <EXIFTOOL>) { *************** *** 22,28 **** if ($field eq "Model") { ($make, $model) = split(/ +/, $value); ! } elsif ($field eq "ColorBalance1") { my $mul_unknown; ! ($mul1, $mul3, $mul2, $mul_unknown) = split(/ +/, $value); } elsif ($field eq "WhiteBalance") { $wbname = $value; --- 24,34 ---- if ($field eq "Model") { ($make, $model) = split(/ +/, $value); ! } elsif ($field eq "ColorBalance1") { # Field for D200 my $mul_unknown; ! ($mulred, $mulblue, $mulgreen, $mul_unknown) = split(/ +/, $value); ! } elsif ($field eq "RedBalance") { # Field for D70 (red) ! $mulred = $value; ! } elsif ($field eq "BlueBalance") { # Field for D70 (blue) ! $mulblue = $value; } elsif ($field eq "WhiteBalance") { $wbname = $value; *************** *** 33,37 **** close EXIFTOOL; ! # Fix names for consistency across Nikons (D70 and D2X use "Direct sunlight") $wbname =~ s/^Sunny$/Direct sunlight/; --- 39,43 ---- close EXIFTOOL; ! # Fix names for consistency across Nikon cameras (D70 and D2X use "Direct sunlight") $wbname =~ s/^Sunny$/Direct sunlight/; *************** *** 40,44 **** $result = sprintf " { \"%s\", \"%s\", \"%s\", %d,", $make, $model, $wbname, $wbfinetune; $result .= " " while length($result) < 48; ! $result .= "{ $mul1, $mul2, $mul3, 0 } },"; # debug: add deltas --- 46,50 ---- $result = sprintf " { \"%s\", \"%s\", \"%s\", %d,", $make, $model, $wbname, $wbfinetune; $result .= " " while length($result) < 48; ! $result .= "{ $mulred, $mulgreen, $mulblue, 0 } },"; # debug: add deltas *************** *** 59,60 **** --- 65,67 ---- #WhiteBalance Incandescent #WhiteBalanceFineTune -3 + |