]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
patch from Kelly A. Campbell
authoreschaeffer <eschaeffer@unknown>
Fri, 24 Nov 2000 11:28:05 +0000 (11:28 +0000)
committereschaeffer <eschaeffer@unknown>
Fri, 24 Nov 2000 11:28:05 +0000 (11:28 +0000)
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
src/org/apache/fop/image/GifJpegImage.java
src/org/apache/fop/image/JimiImage.java
src/org/apache/fop/image/SVGImage.java

index abcd1b4dc57fcfaddf96f802eceed8b468653280..fda25c21ddb764a66bea5d4f98259aa6151eeea3 100644 (file)
@@ -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 (" +
index 3b86c2fdfd61f79d54de1acad1521987c3087b7c..6abf6cce8e365773f490c45f0b41154b0faad28b 100644 (file)
@@ -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);
   }
 
index 049098ede42e9b49ea521870dba331a0b7cf1131..331ff650404ace513c6a23f8a94de7a0faa8fd95 100644 (file)
@@ -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 {
index 6398f2c9f09924803cd53a0f1b8a8eb5fe50af7e..287e6994eccce5964f3abe10e31ba05e4117eba7 100644 (file)
@@ -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);
   }