made ImageIOGenerator the default ImageGenerator, JimiGenerator the fallback scenario

This commit is contained in:
lehni 2005-10-20 11:05:11 +00:00
parent 67d7e915ee
commit 25fd8cb805

View file

@ -56,15 +56,18 @@ public abstract class ImageGenerator {
if (className == null) { if (className == null) {
// if no class is defined, try the default ones: // if no class is defined, try the default ones:
try { try {
Class.forName("com.sun.jimi.core.Jimi"); // start with ImageIO
// if we're still here, JimiWrapper can be used Class.forName("javax.imageio.ImageIO");
className = "helma.image.jimi.JimiGenerator"; // if we're still here, ImageIOWrapper can be used
className = "helma.image.imageio.ImageIOGenerator";
} catch (ClassNotFoundException e1) { } catch (ClassNotFoundException e1) {
try { try {
Class.forName("javax.imageio.ImageIO"); // use Jimi as a fallback scenaio
// if we're still here, ImageIOWrapper can be used Class.forName("com.sun.jimi.core.Jimi");
className = "helma.image.imageio.ImageIOGenerator"; // if we're still here, JimiWrapper can be used
className = "helma.image.jimi.JimiGenerator";
} catch (ClassNotFoundException e2) { } catch (ClassNotFoundException e2) {
throw new RuntimeException("JimiGenerator canot be used. Please make sure you placed jimi.jar in helma/lib/ext");
} }
} }
} }
@ -175,7 +178,7 @@ public abstract class ImageGenerator {
} }
/** /**
* @param url the URL the filename of the image to create * @param url the URL of the image to create
* *
* @return the newly created image * @return the newly created image
* @throws IOException * @throws IOException