aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/image
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2001-09-07 13:56:23 +0000
committerKeiron Liddle <keiron@apache.org>2001-09-07 13:56:23 +0000
commite8b6dcb573f893395ae10346fa3d6f619c96e732 (patch)
tree53591033b8a59ec705275afeb9da2d2e796525ee /src/org/apache/fop/image
parentc15e16fd19db7add4e1aafec6ea4537d3e02d5a5 (diff)
downloadxmlgraphics-fop-e8b6dcb573f893395ae10346fa3d6f619c96e732.tar.gz
xmlgraphics-fop-e8b6dcb573f893395ae10346fa3d6f619c96e732.zip
handles uri's with "url(" + URI + ")"
spec is ambigous about what a <uri-specification> is git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194455 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/image')
-rw-r--r--src/org/apache/fop/image/FopImageFactory.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/org/apache/fop/image/FopImageFactory.java b/src/org/apache/fop/image/FopImageFactory.java
index 7255ca011..8e81761bf 100644
--- a/src/org/apache/fop/image/FopImageFactory.java
+++ b/src/org/apache/fop/image/FopImageFactory.java
@@ -17,7 +17,6 @@ import java.lang.reflect.Constructor;
import java.util.Hashtable;
// FOP
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.image.analyser.ImageReaderFactory;
import org.apache.fop.image.analyser.ImageReader;
import org.apache.fop.configuration.Configuration;
@@ -40,10 +39,25 @@ public class FopImageFactory {
public static FopImage Make(String href)
throws MalformedURLException, FopImageException {
+ /*
+ * According to section 5.11 a <uri-specification> is:
+ * "url(" + URI + ")"
+ * according to 7.28.7 a <uri-specification> is:
+ * URI
+ * So handle both.
+ */
// Get the absolute URL
URL absoluteURL = null;
InputStream imgIS = null;
+ href = href.trim();
+ if(href.startsWith("url(") && (href.indexOf(")") != -1)) {
+ href = href.substring(4, href.indexOf(")")).trim();
+ }
try {
+ // try url as complete first, this can cause
+ // a problem with relative uri's if there is an
+ // image relative to where fop is run and relative
+ // to the base dir of the document
try {
absoluteURL = new URL(href);
} catch (MalformedURLException mue) {