made ImageIOGenerator the default ImageGenerator, JimiGenerator the fallback scenario
This commit is contained in:
parent
67d7e915ee
commit
25fd8cb805
1 changed files with 10 additions and 7 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue