aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2001-06-28 07:23:43 +0000
committerKeiron Liddle <keiron@apache.org>2001-06-28 07:23:43 +0000
commitacd09ee8f7baea5802659500259521cf8ac02929 (patch)
tree1c48a9f2af1e1cb45f9cbff5211c50c4af3a6c48 /src/org/apache
parente0caf8fa9579a1c32838b44e965693a4ca8dee12 (diff)
downloadxmlgraphics-fop-acd09ee8f7baea5802659500259521cf8ac02929.tar.gz
xmlgraphics-fop-acd09ee8f7baea5802659500259521cf8ac02929.zip
changed to correct mime type
catch error if batik not available git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194319 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache')
-rw-r--r--src/org/apache/fop/image/FopImageFactory.java17
-rw-r--r--src/org/apache/fop/image/analyser/SVGReader.java7
2 files changed, 16 insertions, 8 deletions
diff --git a/src/org/apache/fop/image/FopImageFactory.java b/src/org/apache/fop/image/FopImageFactory.java
index 25bf4551a..1d97cee3d 100644
--- a/src/org/apache/fop/image/FopImageFactory.java
+++ b/src/org/apache/fop/image/FopImageFactory.java
@@ -1,7 +1,7 @@
/* $Id$
* 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 @@ public class FopImageFactory {
}
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 @@ public class FopImageFactory {
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 @@ public class FopImageFactory {
} 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)
diff --git a/src/org/apache/fop/image/analyser/SVGReader.java b/src/org/apache/fop/image/analyser/SVGReader.java
index b47aab310..d196190fd 100644
--- a/src/org/apache/fop/image/analyser/SVGReader.java
+++ b/src/org/apache/fop/image/analyser/SVGReader.java
@@ -1,7 +1,7 @@
/* $Id$
* 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 class SVGReader extends AbstractImageReader {
}
public String getMimeType() {
- return "image/svg-xml";
+ return "image/svg+xml";
}
/**
@@ -52,6 +52,9 @@ public class SVGReader extends AbstractImageReader {
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