From 2453cf9ec9c47264a48c34507e16c8056bef0c74 Mon Sep 17 00:00:00 2001 From: eschaeffer Date: Fri, 24 Nov 2000 11:28:05 +0000 Subject: [PATCH] patch from Kelly A. Campbell don't need to compile FOP without Jimi. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193834 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/image/FopImageFactory.java | 25 +++++++++++++++---- src/org/apache/fop/image/GifJpegImage.java | 3 ++- src/org/apache/fop/image/JimiImage.java | 12 ++++++++- src/org/apache/fop/image/SVGImage.java | 2 +- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/org/apache/fop/image/FopImageFactory.java b/src/org/apache/fop/image/FopImageFactory.java index abcd1b4dc..fda25c21d 100644 --- a/src/org/apache/fop/image/FopImageFactory.java +++ b/src/org/apache/fop/image/FopImageFactory.java @@ -159,11 +159,26 @@ public class FopImageFactory { initArgs[0] = absoluteURL; initArgs[1] = imgReader; imageInstance = imageConstructor.newInstance(initArgs); - } catch (Exception ex) { - throw new FopImageException( - "Error creating FopImage object (" + - absoluteURL.toString() + ") : " + ex.getMessage()); - } + } catch (java.lang.reflect.InvocationTargetException ex) { + Throwable t = ex.getTargetException(); + String msg; + if (t != null) { + msg = t.getMessage(); + } + else { + msg = ex.getMessage(); + } + throw new FopImageException( + "Error creating FopImage object (" + + absoluteURL.toString() + ") : " + msg + ); + } catch (Exception ex) { + throw new FopImageException( + "Error creating FopImage object (" + + "Error creating FopImage object (" + + absoluteURL.toString() + ") : " + ex.getMessage() + ); + } if (! (imageInstance instanceof org.apache.fop.image.FopImage)) { throw new FopImageException( "Error creating FopImage object (" + diff --git a/src/org/apache/fop/image/GifJpegImage.java b/src/org/apache/fop/image/GifJpegImage.java index 3b86c2fdf..6abf6cce8 100644 --- a/src/org/apache/fop/image/GifJpegImage.java +++ b/src/org/apache/fop/image/GifJpegImage.java @@ -62,7 +62,8 @@ public class GifJpegImage extends AbstractFopImage { super(href); } - public GifJpegImage(URL href, ImageReader imgReader) { + public GifJpegImage(URL href, ImageReader imgReader) + throws FopImageException { super(href, imgReader); } diff --git a/src/org/apache/fop/image/JimiImage.java b/src/org/apache/fop/image/JimiImage.java index 049098ede..331ff6504 100644 --- a/src/org/apache/fop/image/JimiImage.java +++ b/src/org/apache/fop/image/JimiImage.java @@ -64,10 +64,20 @@ import org.apache.fop.image.analyser.ImageReader; public class JimiImage extends AbstractFopImage { public JimiImage(URL href) throws FopImageException { super(href); + try { + Class c = Class.forName("com.sun.jimi.core.Jimi"); + } catch (ClassNotFoundException e) { + throw new FopImageException("Jimi image library not available"); + } } - public JimiImage(URL href, ImageReader imgReader) { + public JimiImage(URL href, ImageReader imgReader) throws FopImageException { super(href, imgReader); + try { + Class c = Class.forName("com.sun.jimi.core.Jimi"); + } catch (ClassNotFoundException e) { + throw new FopImageException("Jimi image library not available"); + } } protected void loadImage() throws FopImageException { diff --git a/src/org/apache/fop/image/SVGImage.java b/src/org/apache/fop/image/SVGImage.java index 6398f2c9f..287e6994e 100644 --- a/src/org/apache/fop/image/SVGImage.java +++ b/src/org/apache/fop/image/SVGImage.java @@ -65,7 +65,7 @@ public class SVGImage extends AbstractFopImage { super(href); } - public SVGImage(URL href, ImageReader imgReader) { + public SVGImage(URL href, ImageReader imgReader) throws FopImageException { super(href, imgReader); } -- 2.39.5