I'm unable to get an FX-expression to work in combination with other commands, like "roll" or "crop".
For e.g., have a look at the following bash-script, where i try to roll an image of unknown(!) size 10% to the right:
Code: Select all
#!/bin/bash
IMAGE="in/rainbow.jpg"
ROLL=`convert "$IMAGE" -format '+%[fx:floor(page.width*0.1)]+0' info:-`
echo $ROLL
# Prints "+100+0" as expected. No problems so far
convert "$IMAGE" -roll "$ROLL" out/b.jpg
# This one works fine and rolls the image 10% to the right.
# Now combine the above two calls to one:
convert "$IMAGE" -roll '+%[fx:floor(page.width*0.1)]+0' out/a.jpg
# "a.jpg" looks exactly the same as our input image. nothing is rolled. Why?
convert --version
# My version is 6.6.9-7.
Actually this posted script is a heavily stripped down version of my real problem, and in reality I need much more values than this ROLL thing. If I would create a single variable every time - which means an extra process, which reads the whole image again and again - isn't it a waste of resources? :)
So finally, my question is as follows: How can I for e.g. roll my image around 10% horizontally, using an FX expression?
Thank you very much for reading, and I hope, someone will find an answer to my question.
Have a nice day! :)