Skip to content

Commit

Permalink
tools/extract_wb: only use the "White Point" values if there are at l…
Browse files Browse the repository at this point in the history
…east four (darktable-org#1539)

It turns out that the Fujifilm X100F gives both "WB GRB Levels" and
"White Point", in that order.  Unfortunately, the latter has the exact
same values in any image, and only two values, which makes them
unsuitable to figure out the white balance values.  So we avoid using
them by requiring that there be at least four "White Point" values.
  • Loading branch information
levitte authored and LebedevRI committed Sep 27, 2017
1 parent e2de8c4 commit 386ea85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/extract_wb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ ARGV.each do |filename|
red = values[1].to_f/green
blue = values[2].to_f/green
green = 1
elsif tag == "White Point"
elsif tag == "White Point" && values.length > 3
green = (values[1].to_f+values[2].to_f)/2.0
red = values[0].to_f/green
blue = values[3].to_f/green
Expand Down

0 comments on commit 386ea85

Please sign in to comment.