org.im4java.core.CommandException: org.im4java.core.CommandException: magick: no images found for operation

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
youssef
Posts: 1
Joined: 2016-10-30T04:39:18-07:00
Authentication code: 1151

org.im4java.core.CommandException: org.im4java.core.CommandException: magick: no images found for operation

Post by youssef »

I m trying to compare two images located under my OS machine and i m using this method:

Code: Select all


	public boolean compareImages (String expectedScreenShot, String capturedScreenShot, String pdiffCompare) {
		ProcessStarter.setGlobalSearchPath("/usr/local/bin/");
		CompareCmd compare = new CompareCmd();
		// For metric-output
		IMOperation cmpOp = new IMOperation();
		// Set the compare metric
		cmpOp.metric("AE");
		// Add the expected image
		cmpOp.addImage(expectedScreenShot);
		// Add the current image
		cmpOp.addImage(capturedScreenShot);
		// This stores the difference
		cmpOp.addImage(pdiffCompare);
		try {
			// Do the compare
			compare.run(cmpOp);
			compare.getErrorText();
			return true;
		}
		catch (Exception ex) {
			return false;
		}
	}
im using im4java:1.4.0 but when i run compare.run(cmpOp); i m receiving this exception:

org.im4java.core.CommandException: org.im4java.core.CommandException: magick: no images found for operation `-metric' at CLI arg 1 @ error/operation.c/CLIOption/5225.

any help would be appreciated :)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: org.im4java.core.CommandException: org.im4java.core.CommandException: magick: no images found for operation

Post by fmw42 »

Please always provide your IM version and platform. If using IM 7, the syntax for "compare" has changed to "magick compare". Perhaps that is your problem. Also have you checked your metric variable to be sure it has one of the accepted values?
Post Reply