possible bug in fx calcs in HDRI Q32
Posted: 2010-08-11T20:03:03-07:00
If I do the following in IM 6.6.3.4 Q16 HDRI Mac OSX Tiger,
gain1=`convert xc:gray -format "%[fx:1/maxima]" info:`
echo "gain1=$gain1"
convert xc: -format "%[fx:quantumrange]" info:
max=`convert xc:gray -format "%[max]" info:`
echo "max=$max"
gain2=`convert xc: -format "%[fx:quantumrange/$max]" info:`
echo "gain2=$gain2"
Then I get gain1=gain2=2
But if I do the same in Q32 HDRI, I get
gain1=2.02381
gain2=2.02381e+18
I think the fx calc has problems with both numerator and denominator are in scientific notation, as here we have:
QuantumRange=4.29497e+09
and
max=2.12222e+09
and
gain2=4.29497e+09/2.12222e+09
which should be about 2, but ends up as 2.02381e+18. Looks like the two e+9 are added to get e+18 rather than subtracted to get e+0
gain1=`convert xc:gray -format "%[fx:1/maxima]" info:`
echo "gain1=$gain1"
convert xc: -format "%[fx:quantumrange]" info:
max=`convert xc:gray -format "%[max]" info:`
echo "max=$max"
gain2=`convert xc: -format "%[fx:quantumrange/$max]" info:`
echo "gain2=$gain2"
Then I get gain1=gain2=2
But if I do the same in Q32 HDRI, I get
gain1=2.02381
gain2=2.02381e+18
I think the fx calc has problems with both numerator and denominator are in scientific notation, as here we have:
QuantumRange=4.29497e+09
and
max=2.12222e+09
and
gain2=4.29497e+09/2.12222e+09
which should be about 2, but ends up as 2.02381e+18. Looks like the two e+9 are added to get e+18 rather than subtracted to get e+0