Error code 132?

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
Brendon
Posts: 1
Joined: 2016-11-11T01:42:33-07:00
Authentication code: 1151

Error code 132?

Post by Brendon »

I'm trying to setup a portable version of ImageMagick for use in a Unity3D project to pre-process textures during the build phase. I need a portable version because I am using a cloud build service run by Unity that doesn't provide me access to the host OS X machine. During my initial tests I ran into error code 133, missing .dylib dependencies (libpng, libtiff, etc) that have been resolved. Now that those issues fixed I am now getting an error code 132 but no output to explain what it is.

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;
}
I've tried running the other cmd line tools, identify --version for example, with the same error code and lack of output. Ive also tried adding debug environment variables without any success.

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?
Post Reply