I am trying to call convert.exe trough Process class from C# to convert a specific image to another format like this:
File.WriteAllBytes(inputFilePath, Convert.FromBase64String(image.Content));
Elmah.ErrorLog.GetDefault(HttpContext.Current).Log(new Error(new Exception("Succesfully wrote the image to: " + inputFilePath)));
var proc = new Process();
proc.StartInfo.Arguments = string.Format("{0} {1}", inputFilePath, outputFilePath);
proc.StartInfo.FileName = @"c:\Program Files (x86)\ImageMagick-6.7.7-Q16\convert.exe";
proc.StartInfo.CreateNoWindow = false;
proc.StartInfo.UseShellExecute = false;
proc.Start();
proc.WaitForExit();
I do not understand why it opens a command prompt and shuts it down immediately…Do you see any error in the code? The path to convert.exe is fine for sure…
You can attach a Stream to the Process object to capture the output.
see the msdn doc