Jump to content

Recommended Posts

Posted

Okay... I give up... all I want to do is run the Imagemagick command line to resize an image. What am I doing wrong?

For $i = 1 To $CmdLine[0]
    $nextPicPath = $CmdLine[$i]
    ResizePic($nextPicPath)
Next

Func ResizePic($myPicPath)
    $myPathPieces = StringSplit($myPicPath, "\")
    $myFilename = $myPathPieces[$myPathPieces[0]]
    $myCmd = "convert """ & $myPicPath & """ -resize 800 ""C:\Temp\" & $myFilename & """"
    Run($myCmd)
EndFunc

Of course ShellExecute doesn't work either.

However, when I run $myCmd manually, it does work.

Posted

Is the convert file in a directory thats in your %PATH% (enviroment variable)?

Yes. I can ConsoleWrite $myCmd, copy and paste to the command line, and it works fine. (from anywhere)

Posted

@Matthew1344

Maybe this can help you out.

ImageMagick in AU3

Regards

ptrex

Yeah... I knew about the COM object. I was just hoping to keep it as simple as possible. I've never had any difficulty in running a simple command before.

I plan to use the COM object, but I'm still terribly curious why the above didn't work.

Posted

What error do you get?

That's just it. There's no error. The conversion simply doesn't happen. The Windows console window pops up briefly, but it's too fast to even produce any visible output.

-Matt

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...