Update of /cvsroot/ufraw/ufraw
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30707

Modified Files:
        wb_extract.pl 
Log Message:
Update wb_extract.pl to use recent versions of exiftool. Patch by Sebastian 
Kraus.

Index: wb_extract.pl
===================================================================
RCS file: /cvsroot/ufraw/ufraw/wb_extract.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- wb_extract.pl       9 Jan 2013 16:30:07 -0000       1.5
+++ wb_extract.pl       15 Oct 2013 14:30:10 -0000      1.6
@@ -32,16 +32,16 @@
 
 for my $file (@ARGV) {
   if ($file eq "-const") {
-       $const_WB = 1;
-       next
+    $const_WB = 1;
+    next
   }
 
   my ($make, $model, $fw_version, $wbname, $wbfinetune, $wbfinetune_1, 
$mulred, $mulgreen, $mulblue);
   $mulgreen = 1;  # default value for green balance
-  $wbfinetune = $wbfinetune_1 = 0;  # avoid warnings about uninitialized vars
+  $wbfinetune = $wbfinetune_1 = 0, $mulred = -1, $mulblue = -1;  # avoid 
warnings about uninitialized vars
 
-  open(EXIFTOOL, "exiftool -s -t -Model -CanonModelID -FirmwareVersion 
-ColorBalance1 -RedBalance -BlueBalance -WhiteBalance -WBShiftAB 
-WBBracketValueAB $file|") 
-    or die "can't open $file: $!";
+  open(EXIFTOOL, "exiftool -s -t -Model -CanonModelID -SonyModelID 
-FirmwareVersion -Software -ColorBalance1 -RedBalance -BlueBalance 
-WhiteBalance -WBShiftAB -WBBracketValueAB -\"WB_RGGB*\" $file|") 
+  or die "can't open $file: $!";
   while (my $line = <EXIFTOOL>) {
     $line =~ /([^\t]+)\t(.*)/ or next;
     my ($field, $value) = ($1, $2);
@@ -49,8 +49,12 @@
       ($make, $model) = split(/ +/, $value);
     } elsif ($field eq "CanonModelID") {
       $model = $value;
+    } elsif ($field eq "SonyModelID") {
+      $model = $value;
     } elsif ($field eq "FirmwareVersion") {
       $fw_version = $value;
+    } elsif ($field eq "Software") {
+      $fw_version = $value;
     } elsif ($field eq "ColorBalance1") {   # Field for D200
       my $mul_unknown;
       ($mulred, $mulblue, $mulgreen, $mul_unknown) = split(/ +/, $value);
@@ -66,6 +70,25 @@
       $wbfinetune = $value;
     } elsif ($field eq "WBBracketValueAB") {
       $wbfinetune_1 = $value;
+    } elsif ($field eq "WB_RGGBLevels") {
+      my ($mul_tmp1, $mul_tmp2, $mul_tmp3, $mul_tmp4) = split(/ +/, $value);
+      $mulred = ($mul_tmp1 / $mul_tmp2);
+      $mulblue = ($mul_tmp4 / $mul_tmp3);
+    } elsif ($field =~ /WB_RGGBLevels/) { # Get embedded whitebalance values
+      $field =~ s/^WB_RGGBLevels//; # Truncate for whitebalance-name
+      my ($mul_tmp1, $mul_tmp2, $mul_tmp3, $mul_tmp4) = split(/ +/, $value);
+      
+      my $tmp_mulred = ($mul_tmp1 / $mul_tmp2);
+      my $tmp_mulblue = ($mul_tmp4 / $mul_tmp3);
+      
+      my $result;
+      $result = sprintf "  { \"%s\", \"%s\", ", $make, $model;
+      $result .= sprintf "\"%s\", ", $field;
+      $result .= sprintf "%d,", 0;
+      $result .= " " while length($result) < 48;
+      $result .= "{ $tmp_mulred, 0, $tmp_mulblue, 0 } },";
+  
+      print $result, "\n";
     }
   }
   close EXIFTOOL;


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
ufraw-cvs mailing list
ufraw-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ufraw-cvs

Reply via email to