Windows 10 System Command Issue

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Posts: 1
Joined: 2019-06-03T23:39:40-07:00
Authentication code: 1152

Windows 10 System Command Issue

Post by whumber » 2019-06-03T23:51:10-07:00


I'm probably doing things the dumbest way possible, but I put together a small code that uses ImageMagick 7.0.8 to do a very simple overlay. I have a fortran code compiled with Intel Parallel Studio that does get all the setup information and then issues a system command to run ImageMagick to do all the heavy lifting for the overlay. The issue I'm having is that when I either issue a system command in the fortran code or even try to run ImageMagick with a batch script it fails, but if I take that exact same command and just copy and paste it into either a terminal or powershell window then it works without issue. The code to execute the system command is shown below

! use imagemagick composite to overlay the af point template and export a jpg
imgmgkcmd = "magick composite -gravity center -geometry '"//trim(scaleChar)//"%%x"//&
trim(scaleChar)//"%%"//trim(offsetCharX)//trim(offsetCharY)//"' af_point_EM1X.png "&
//adjustl(trim(fileChar))//" "//adjustl(trim(fileTitle))//".jpg"

! execute the image magick command
call execute_command_line(trim(imgmgkcmd))

and what actually goes to the command line looks like the example below (which works if pasted in).

magick composite -gravity center -geometry '200%%x200%%+508-1100' af_point_EM1X.png P6012527.ORF P6012527.jpg

Any ideas? When it fails, it seems to be mostly complaining about the argument passed to -geometry. I assume I must be doing something pretty dumb.

EDIT: Bah, nevermind I got it like 30 seconds after posting this. Changing from single to double quotes seemed to fix the issue.

Post Reply