Inconsistent behavior with "-define distort:viewport"
Posted: 2016-12-15T18:39:46-07:00
Using IM 7.0.3-10 on Windows 10 64, I've come across an inconsistency when using "-define distort:viewport". If I define the viewport with simple WxH dimensions, the result of this command is a 360x240 image as I would expect...
The discrepancy occurs if I try to use percent escapes or FX expressions to define that viewport. All these commands result in output images that are still the same 640x480 dimensions as the input "logo:"...
I've tried this with and without quote marks around the expressions, with simple escapes like "%w", with square brackets like "%[w]", and with complete FX expressions like "%[fx:w*2]". None of them change the viewport dimensions, but just plain 360x240 does.
When I use "-set option:distort:viewport" as an alternative, there are no issues with any escapes, FX expressions, or quote marks.
Code: Select all
magick logo: -define distort:viewport=320x240 -distort SRT 0 test0.png
Code: Select all
magick logo: -define distort:viewport=320x%w -distort SRT 0 test1.png
magick logo: -define distort:viewport=320x%[w] -distort SRT 0 test2.png
magick logo: -define distort:viewport=320x%[fx:120+120] -distort SRT 0 test3.png
magick logo: -define distort:viewport="%[fx:w/2]x240" -distort SRT 0 test4.png
When I use "-set option:distort:viewport" as an alternative, there are no issues with any escapes, FX expressions, or quote marks.