I'm executing the process through .NET. My setup looks as such so far:
Code: Select all
public static bool ResizeUnity(string inputPath, string outputPath, int width, int height)
{
string toolHome = Application.dataPath + "/ImageProcessing/Editor";
string magickHome = toolHome + "/imagemagick/6.9.6-3";
string[] libs =
{
toolHome + "/libpng/1.6.26/lib",
toolHome + "/libtiff/4.0.6_3/lib",
toolHome + "/jpeg/8d/lib",
toolHome + "/freetype/2.7/lib",
};
string textToolPath = magickHome + "/bin/convert";
ProcessStartInfo startInfo = new ProcessStartInfo
{
FileName = textToolPath,
Arguments = string.Format("'{0}' -resize {2}x{3} '{1}'", inputPath, outputPath, width, height),
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true
};
startInfo.EnvironmentVariables.Add("MAGICK_HOME", magickHome);
startInfo.EnvironmentVariables.Add("DYLD_LIBRARY_PATH", string.Join(":", libs));
//startInfo.EnvironmentVariables.Add("MAGICK_DEBUG", "exception,trace");
Process p = new Process
{
StartInfo = startInfo
};
try
{
if (!p.Start())
{
Debug.LogError("ImageProcessing: Failed to start process.");
}
else
{
string error = p.StandardError.ReadToEnd();
if (!string.IsNullOrEmpty(error))
{
Debug.LogError("ImageProcessing ERROR: " + error);
}
string output = p.StandardOutput.ReadToEnd();
if (!string.IsNullOrEmpty(output))
{
Debug.LogError("ImageProcessing OUTPUT: " + output);
}
p.WaitForExit();
if (p.ExitCode != 0)
{
Debug.LogError(string.Format("ImageProcessing: Non-zero exit code {0}.", p.ExitCode));
}
}
}
catch (Exception e)
{
Debug.LogError("ImageProcessing EXCEPTION: " + e);
}
return true;
}
My assumption is that I'm still missing some set of dependencies but, without info from the command line, I'm not sure what?
Does anyone know what error code 132 means?