Page 1 of 1

possible bug -fx logtwo()

Posted: 2010-08-30T19:12:28-07:00
by fmw42
IM 6.6.3.9 Q16 HDRI Mac OSX Tiger

Error message when try to use -fx function logtwo() (log base 2) per http://www.imagemagick.org/script/fx.php

Example:


convert -size 100x100 gradient: grad100.png

convert grad100.png -fx "logtwo(2*u+1)" grad100_log2_test.pfm
convert: unable to parse expression `wo(2*u+1)' @ error/fx.c/FxGetSymbol/1843.

Must be a typo somewhere.

Re: possible bug -fx logtwo()

Posted: 2010-08-30T19:31:32-07:00
by el_supremo
I assume it is caused by the code starting at line 2565 in fx.c:

Code: Select all

      if (LocaleNCompare(expression,"logtwo",4) == 0)
        {
          alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,beta,
            exception);
          return((MagickRealType) log10((double) alpha))/log10(2.0);
        }
Both occurrences of 4 should be 6.

Pete

Re: possible bug -fx logtwo()

Posted: 2010-08-30T20:12:09-07:00
by fmw42
Thanks, Pete. that should make it easy for Magick to fix.

Fred