Variable argument in a string
Posted: 2018-05-05T16:54:09-07:00
I'm trying to create a thin border around image edge which has margin 16px from its size:
But it is ended up with error:
I expect that this is an error when reading %w% but not treated as variable.
What to do to make this works out?
This code runs through batch, so I need escape %w% with %%w%%
ImageMagick v7 - Windows 10
Code: Select all
convert Original\0_0.png -bordercolor none -border 16 -fill none -stroke red -strokewidth 1 -draw "rectangle 0,0 %%w%%,%%h%%" 0_0.png
Code: Select all
convert Original\0_0.png -bordercolor none -border 16 -fill none -stroke red -strokewidth 1 -draw "rectangle 0,0 %w%,%h%" 0_0.jpg
convert: non-conforming drawing primitive definition `rectangle' @ error/draw.c/DrawImage/3401.
What to do to make this works out?
This code runs through batch, so I need escape %w% with %%w%%
ImageMagick v7 - Windows 10