i have two images I-1 and I-2, i was able to compare these two images using im4java successfully. However now I-1 and I-2 has different size and therefore when i try to compare these two images it do not compare them and gives message
ex: org.im4java.core.CommandException: org.im4java.core.CommandException: compare.exe: image widths or heights differ `C:\Users\hp\workspace-getlinks-multipurpose\links_extractor/snapshots/actuals/id-dashboard.jpg' @ error/compare.c/CompareImageCommand/990.
Following is my code:
public static boolean compareImages(String exp, String cur,String output) {
// This instance wraps the compare command
CompareCmd compare = new CompareCmd();
// For metric-output
//compare.setErrorConsumer(StandardStream.STDERR);
IMOperation cmpOp = new IMOperation();
// Set the compare metric
cmpOp.metric("mae");
// cmpOp.addSubOperation(subimageSearch());
// Add the expected image
cmpOp.addImage(exp);
// Add the current image
cmpOp.addImage(cur);
// This stores the difference
cmpOp.addImage(output);
try {
// Do the compare
compare.run(cmpOp);
return true;
} catch (Exception ex) {
System.out.println("ex: "+ex);
return false;
}
}