aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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) {