Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

SRP_Run_Command output

edited December 2015 in SRP Utilities
I'm using the command line interface of ImageMagick via SRP_Run_Command() to convert and get information about images. These programs return information to the DOS window. eg
output = 'VAR' Call SRP_Run_Command( 'convert -help', output, 'ImageMagick')
will return the help for the Convert command.

However I'm puzzled why this doesn't seem to work for any of the other ImageMagick commands. I particularly need it for the Identify command, which returns image information. If I change output to 'DOSOPEN', the information does show in a DOS window, but it doesn't seem to be returned in a variable or an OI editfield.

Any ideas? Is there another way I can get this information back into Basic+?

Cheers, M@

Comments

  • Matt,

    I'm going to guess that this is a problem with the content of your Command argument (which you did not provide) and possibly your WorkingDir argument (is that a relative path?).

    I copied the donate.png file from the /images folder into the same folder where Identify.exe is located and then ran this code:
    Command = 'C:\ImageMagick\Identify.exe donate.png' Output = 'VAR' WorkingDir = 'C:\ImageMagick' SRP_Run_Command(Command, Output, WorkingDir)
    This yielded the following results in the Output variable:
    donate.png PNG 92x26 92x26+0+0 8-bit sRGB 1.42KB 0.000u 0:00.000
  • Thanks for trying this out, Don! The command I was using was just 'identify -help' or 'identify image.bmp'

    It appears that the full path is required in the command for all commands, except 'convert'. 'convert' can be used without full path - unless I state 'convert.exe' explicitly, in which case I get "Invalid drive specification."!? Curiously I tried copying convert.exe to convert2.exe and this, like the other commands, requires the full path in the command.

    That's weird - it seems there's something special about the word 'convert' as the command.

    Thanks for your help, and Happy Christmas!
    Cheers, M@
Sign In or Register to comment.