getJAI() fails with exception causing the application to crash
Opened this issue · 0 comments
Scholvac commented
Hi,
I just stumbled over an exception inside the BufferedImageHelper, that causes my application to crash.
I'm running in an plugin environment and are not able to load the JAI object, using the ComponentFactory (as indicated by the comments inside the ComponentFactory.create method).
However switching the order of statements inside the BufferedImageHelper.getJAI() method solves the issue for me.
Now I'm just getting one exception at the beginning and can use the fallback method you provided.
In my solution the BufferedImageHelper.getJAI() method looks like:
protected static Object getJAI() {
if (!checkedForJAI) {
checkedForJAI = true; //mark as checked before the exception occurs to not check again
jaiObj = ComponentFactory.create("javax.media.jai.JAI");
}
return jaiObj;
}