How do you run CompareCmd in Java from version 7?
The previous versions running would run , but now in
version 7 running compare runs magick compare, which throws error
magick: no images found for operation `-metric’ at CLI arg 1 @
error/operation.c/CLIOption/5227. Please advise.
If I add in op.addRawArgs(“compare”); then run the comparecmd I get org.im4java.core.CommandException: java.lang.NullPointerException
at org.im4java.core.ImageCommand.run(ImageCommand.java:219)

CompareCmd compare = new CompareCmd();
compare.setSearchPath(imageMagickBinPath);
compare.setErrorConsumer(StandardStream.STDERR);

IMOperation op = new IMOperation();
op.addRawArgs("compare");
op.metric("AE");
op.fuzz(10.0);

op.addImage(screenShotPath1);
op.addImage(screenShotPath2);
op.addImage(imageCompareResultFile.getAbsolutePath());

    //Execute the Operation
    try {
        compare.run(op);
        isSame=true;
    } 
    catch (Exception e) 
    {
        isSame=false;
    }



Source link https://sqa.stackexchange.com/questions/34861/imagemagick-compare---org-im4java-core-commandexception-java-lan

LEAVE A REPLY

Please enter your comment!
Please enter your name here