keiron 01/06/28 00:23:47
Modified: src/org/apache/fop/image FopImageFactory.java
src/org/apache/fop/image/analyser SVGReader.java
Log:
changed to correct mime type
catch error if batik not available
Revision Changes Path
1.20 +12 -7 xml-fop/src/org/apache/fop/image/FopImageFactory.java
Index: FopImageFactory.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/image/FopImageFactory.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- FopImageFactory.java 2001/06/25 09:00:42 1.19
+++ FopImageFactory.java 2001/06/28 07:23:35 1.20
@@ -1,7 +1,7 @@
-/* $Id: FopImageFactory.java,v 1.19 2001/06/25 09:00:42 keiron Exp $
+/* $Id: FopImageFactory.java,v 1.20 2001/06/28 07:23:35 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
- * LICENSE file included with these sources."
+ * LICENSE file included with these sources.
*/
package org.apache.fop.image;
@@ -51,12 +51,16 @@
}
imgIS = absoluteURL.openStream();
} catch (MalformedURLException e_context) {
- throw new FopImageException("Error with image URL: " +
e_context.getMessage());
- } catch (Exception e) {
+ throw new FopImageException("Error with image URL: " +
+ e_context.getMessage());
+ }
+ catch (Exception e) {
// maybe relative
URL context_url = null;
try {
- absoluteURL = new URL(Configuration.getStringValue("baseDir") +
absoluteURL.getFile());
+ absoluteURL = new URL(
+ Configuration.getStringValue("baseDir") +
+ absoluteURL.getFile());
} catch (MalformedURLException e_context) {
// pb context url
throw new FopImageException(
@@ -77,7 +81,8 @@
if (imgIS == null) {
imgIS = absoluteURL.openStream();
}
- imgReader = ImageReaderFactory.Make(absoluteURL.toExternalForm(),
imgIS);
+ imgReader = ImageReaderFactory.Make(
+ absoluteURL.toExternalForm(), imgIS);
} catch (Exception e) {
throw new FopImageException(
"Error while recovering Image Informations (" +
@@ -113,7 +118,7 @@
} else if ("image/tiff".equals(imgMimeType)) {
imgClassName = "org.apache.fop.image.JimiImage";
// imgClassName = "org.apache.fop.image.JAIImage";
- } else if ("image/svg-xml".equals(imgMimeType)) {
+ } else if ("image/svg+xml".equals(imgMimeType)) {
imgClassName = "org.apache.fop.image.SVGImage";
}
if (imgClassName == null)
1.7 +6 -3 xml-fop/src/org/apache/fop/image/analyser/SVGReader.java
Index: SVGReader.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/image/analyser/SVGReader.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SVGReader.java 2001/06/08 08:58:22 1.6
+++ SVGReader.java 2001/06/28 07:23:43 1.7
@@ -1,7 +1,7 @@
-/* $Id: SVGReader.java,v 1.6 2001/06/08 08:58:22 keiron Exp $
+/* $Id: SVGReader.java,v 1.7 2001/06/28 07:23:43 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
- * LICENSE file included with these sources."
+ * LICENSE file included with these sources.
*/
package org.apache.fop.image.analyser;
@@ -33,7 +33,7 @@
}
public String getMimeType() {
- return "image/svg-xml";
+ return "image/svg+xml";
}
/**
@@ -52,6 +52,9 @@
this.height =
(int) svg.getHeight().getBaseVal().getValue();
return true;
+ } catch (NoClassDefFoundError ncdfe) {
+ MessageHandler.errorln("Batik not in class path");
+ return false;
} catch (Exception e) {
MessageHandler.errorln("ERROR LOADING EXTERNAL SVG: " + e.getMessage());
// assuming any exception means this document is not svg
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]