Using %[fx:] with -repage
Posted: 2015-09-01T06:23:58-07:00
I'm using the Windows Commandline version of Convert and I have a batch file that contains the following command:
I get the error "convert.exe: invalid argument for option '-repage': ^+%[fx:w]^+0 @ error/convert.c/ConvertImageCommand/2551
If I replace +%%[fx:w] with a number (512 say) then the command behaves as expected. Elsewhere in the command I use %%[fx:... successfully, but I don't seem able to use it with -repage.
Can anyone spot what I'm doing wrong?
Thanks
Convert -version produces:
Version: ImageMagick 6.9.2-0 Q16 x64 2015-08-15 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib
Code: Select all
convert^
-virtual-pixel horizontal-tile-edge^
-verbose^
%1^
^( -clone 0^
-set option:distort:viewport "%%[fx:w/2]x%%[fx:h]+0+0"^
-distort affine "0,0,0.5,0.5,%%[fx:w/2],%%[fx:h],%%[fx:w/2-0.5],%%[fx:h-0.5]"^
-repage "+%%[fx:w]+0"^
^)^
^( -clone 0^
-set option:distort:viewport "%%[fx:w/2]x%%[fx:h]+%%[fx:w/2]+0"^
-distort affine "%%[fx:w/2],0,%%[fx:w/2+0.5],0.5,%%[fx:w],%%[fx:h],%%[fx:w-0.5],%%[fx:h-0.5]"^
-repage +0+0^
^)^
-delete 0^
-layers merge^
+repage^
%2
If I replace +%%[fx:w] with a number (512 say) then the command behaves as expected. Elsewhere in the command I use %%[fx:... successfully, but I don't seem able to use it with -repage.
Can anyone spot what I'm doing wrong?
Thanks
Convert -version produces:
Version: ImageMagick 6.9.2-0 Q16 x64 2015-08-15 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib