Then I just added the code I want to test, and it's failing all the same.
Added code
else if(e.getSource() == buttonDiff){
MarvinAttributes attrOut = new MarvinAttributes();
imagePlugin = MarvinPluginLoader.loadImagePlugin("org.marvinproject.image.difference.differenceColor");
MarvinImage image2 = MarvinImageIO.loadImage("./ref/2C.jpg");
MarvinImageIO.saveImage(image2, "./out/c.jpg");
imagePlugin.process(image, image2, attrOut);
}
Stack trace:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.marvinproject.image.difference.differenceColor.DifferenceColor.process(DifferenceColor.java:67)
at marvin.plugin.MarvinAbstractImagePlugin.process(MarvinAbstractImagePlugin.java:65)
at org.xxxxx.marvin.fistApp.FirstApplication.actionPerformed(FirstApplication.java:102)
DifferenceColor.java @ 67 says: l_redB = imageB.getIntComponent0(x, y); So seems imageB is null in the scope, but you can ensure it's not at invocation time, notice "MarvinImageIO.saveImage(image2, "./out/c.jpg");", it works ok.
Can this be a bug introduced by a later version?
Regards.