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.
Running ImageMagick-6.9.6-0-Q16-HDRI-x64-static on Windows 10 64, it appears there's a problem using FX expression substitutions in a "-distort Resize" operation. Both of these commands should resize the gradient to 240x120 pixels...
Instead they both run without warnings or errors, but they produce output images which are still 480x240. IM6 doesn't seem to have any trouble using FX expressions and substitutions with other "-distort" methods like "Affine". Is there a reason it shouldn't work with "-distort Resize", or is this maybe a bug?
snibgo wrote:I wasn't aware that FX expressions are supposed to work with "-distort Resize" on v6.
While it may be that FX escapes aren't meant to work with "-distort Resize", the documentation mentions HERE that "You can also use Percent Escapes within the distort arguments," and provides an example using "-distort Affine". I've tried the example in various ways with simple escapes and with expressions like "%[fx:w*2]", and it seems to work as expected.
Historically, I think "-distort resize" was added after the other distorts, as a drop-in replacement for "-resize", so had to parse and process its arguments in the same way.
For v6, in wand\mogrify.c, function MogrifyImage(), after "-distort" is found, the "resize" method is treated differently to all other methods. "resize" uses ParseRegionGeometry(), but all other methods use InterpretImageProperties(), and this is what translates %[stuff].
snibgo wrote:Historically, I think "-distort resize" was added after the other distorts, as a drop-in replacement for "-resize", so had to parse and process its arguments in the same way.
That makes sense. I use IM7 for almost everything, but I keep a recent IM6 installed so I can test stuff, mostly for questions on this forum. I didn't know if FX escape and expression processing was part of "-distort" or part of each method.