Precision of variables in fx

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
snibgo
Posts: 10035
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Precision of variables in fx

Post by snibgo » 2017-12-31T17:28:19-07:00

Using a variable within an fx expression kills precision. For example:

Code: Select all

f:\prose\PICTURES>%IM%identify -precision 16 -format "%[fx:1/49]" xc:
0.02040816326530612

f:\prose\PICTURES>%IM%identify -precision 16 -format "%[fx:V=1/49;V]" xc:
0.0204082
Tested with v6.9.5-3 Q16 on Windows 8.1.
snibgo's IM pages: im.snibgo.com

User avatar
magick
Site Admin
Posts: 10775
Joined: 2003-05-31T11:32:55-07:00

Re: Precision of variables in fx

Post by magick » 2017-12-31T18:59:07-07:00

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.

User avatar
GeeMack
Posts: 562
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Precision of variables in fx

Post by GeeMack » 2017-12-31T19:00:57-07:00

snibgo wrote:
2017-12-31T17:28:19-07:00
Tested with v6.9.5-3 Q16 on Windows 8.1.
I get the same results with IM 7.0.7-18 Q16 HDRI, running the commands on Windows 10 64, with "magick identify ...".

Post Reply