Menu

compare.run() throws exception

Help
PShah
2014-03-28
2014-04-11
  • PShah

    PShah - 2014-03-28

    I am getting CommandException while running the compare.run()

    Exception:

    org.im4java.core.CommandException: org.im4java.core.CommandException: 799603
    at org.im4java.core.ImageCommand.run(ImageCommand.java:219)
    Caused by: org.im4java.core.CommandException: 799603
    at org.im4java.core.ImageCommand.finished(ImageCommand.java:253)
    at org.im4java.process.ProcessStarter.run(ProcessStarter.java:314)
    at org.im4java.core.ImageCommand.run(ImageCommand.java:215)
    ... 2 more

    Code Snippet:
    CompareCmd compare = new CompareCmd();
    ArrayListOutputConsumer output = new ArrayListOutputConsumer();
    IMOperation cmpOp = new IMOperation();
    cmpOp.metric("AE"); // root mean squared (normalized root mean squared)
    cmpOp.fuzz(10.0);
    cmpOp.addImage();
    cmpOp.addImage();
    cmpOp.addImage();

    try {
    compare.setOutputConsumer(output);
    compare.run(cmpOp, getScreenshotDir+ "/MIFF-"+nonBaseImg,
    getScreenshotDir+ "/MIFF-"+baseImg,
    getScreenshotDir+ "/MIFF-"+nonBaseImg+"diff");
    DisplayCmd.show(getScreenshotDir+ "/MIFF"+nonBaseImg+"
    diff");
    log.info('\n');
    } catch (IOException | InterruptedException | IM4JavaException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }

     
  • Bernhard Bablok

    Bernhard Bablok - 2014-03-29

    Hi,

    please provide more information, like os-version, java-version and so on - the stack-trace is not really helpful. Please also try to run the command from the commandline, maybe this gives some insight. Does a simple convert example work for you, or does it fail as well?

    Bernhard

     
  • PShah

    PShah - 2014-04-01

    I am running it on Mac OSX 10.9.2 and my java version is 1.7.0_45. I was able to run the command just fine from the command line. Even here the convert command converts the images to MIFF and the compare command throws exception. Let me know if you need more info to debug..

     
  • Bernhard Bablok

    Bernhard Bablok - 2014-04-01

    Hi,

    if you have the same error on the commandline, then you should upgrade your ImageMagick installation (im4java just calls the commandline program). Maybe you can also ask on the ImageMagick forums for help.

    Bernhard

     
  • PShah

    PShah - 2014-04-01

    Thats the thing I am not getting error when I run the same command through command line..

     
  • PShah

    PShah - 2014-04-09

    Can anybody help with the above issue? I can not even run the std Testcase24.java due to this issue..

     
  • Bernhard Bablok

    Bernhard Bablok - 2014-04-11

    If you can't even run the test-case, it is probably not an error of im4java. Are you sure you have setup your environment correctly as described in the user's guide? If you run compare on the commandline you might have a different search-path.

    Anyhow, if you want more help you should not post it here, but on the mailing list as documented on the im4java-homepage. The chance that some Mac users are reading the mailing-list is much higher.

    Bernhard

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.