when were fx calculations first available?

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

when were fx calculations first available?

Post by fmw42 »

I am trying to run a bash script on my web site hosted by Godaddy using PHP and exec command, but I find that their version of IM at 6.2.7.9 is so old that many things do not work. For example a simple fx calculation fails to return anything, such as


RRV=`/usr/local/bin/convert xc: -format "%[fx:255*$RR/$qr]" info:`

or even

qrange=`/usr/local/bin/convert xc: -format "%[fx:quantumrange]" info:`

Furthermore, they do not even have the unix function bc available to replace the fx calculation.

I am trying to get Godaddy to upgrade their IM and make bc avialable, but don't know whether they will do it or not, yet. I suppose I will have to rewrite my bash script using mostly PHP calculations.

Nevertheless, I am curious. Can anyone tell me when fx calculations were first introduced into IM. I checked the changelog, but it does not go back further than 6.3.1.6?


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

Re: when were fx calculations first available?

Post by magick »

You can always check legacy releases at http://sourceforge.net/projects/imagemagick/ but even then, -fx was enhanced substantially over time meaning that early versions of the -fx option may not support your expressions.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: when were fx calculations first available?

Post by anthony »

From FX Espressions...
http://www.imagemagick.org/Usage/transform/#fx_escapes
As of IM version 6.2.10 you can now use FX Expressions within Image Property Escaped strings such as used by "-format" and "-annotate" arguments.
I grabbed and kept a copy of the change log from before that version - it is 80Kb
in size! Current change log is now 94Kb!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: when were fx calculations first available?

Post by fmw42 »

Thanks. But seems that my ISP is only providing IM 6.2.6-9. So I am out of luck on doing much on Godaddy with running exec in PHP to run IM commands. And they don't provide bc either. So I am having to rewrite my whole script mostly in PHP to all the math calculations.

I cannot get quantumrange. So I have to use the Q value and an if statement. Do you know what the quantumrange is for Q32.

Also txt: does not print out the hex value in that old release, so I have to compute it from the rgb values.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: when were fx calculations first available?

Post by anthony »

Q32 -> QuantumRange = 2^32-1
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply