possible bug -fx logtwo()

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible bug -fx logtwo()

Post 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.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: possible bug -fx logtwo()

Post 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
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug -fx logtwo()

Post by fmw42 »

Thanks, Pete. that should make it easy for Magick to fix.

Fred
Post Reply