I try to manipulate pictures with imageick. On the CLI I use this working fine command:
C:\ProgrammeNoSetup\ImageMagick-7.1.0-62-portable-Q16-HDRI-x64\magick.exe D:\orG\3.08_10-02_1.jpg -resize 1200x1200 D:\orG\output\3.08_10-02_1.jpg
But I try to that in a powershell script (test.ps1) with this code:
$CMD = 'C:\ProgrammeNoSetup\ImageMagick-7.1.0-62-portable-Q16-HDRI-x64\magick.exe'
$arg2 = 'D:\orG\3.08_10-02_1.jpg'
$arg3 = '-resize 1200x1200'
$arg4 = 'D:\orG\output\3.08_10-02_1.jpg'
& $CMD $arg2 $arg3 $arg4
Im getting this error: magick.exe: unrecognized option `-resize 1200x1200' at CLI arg 2 @ fatal/magick-cli.c/ProcessCommandOptions/659.
I have also tried:
$CMD = 'C:\ProgrammeNoSetup\ImageMagick-7.1.0-62-portable-Q16-HDRI-x64\magick.exe'
$arg1 = 'convert'
$arg2 = 'D:\orG\3.08_10-02_1.jpg'
$arg3 = '-resize 1200x1200'
$arg4 = 'D:\orG\output\3.08_10-02_1.jpg'
& $CMD $arg1 $arg2 $arg3 $arg4
But the error is similar: convert: unrecognized option `-resize 1200x1200' @ error/convert.c/ConvertImageCommand/2686.
If I remove the option "-resize 1200x1200". There is now error message and the command is writing the file (without resize) to the output folder. So I think, that I have a problem with my option, but I can't find it. I have invested several hours and als tried with the @-symbol for arguments, without success.