keiron 01/09/07 06:56:23
Modified: src/org/apache/fop/image FopImageFactory.java
Log:
handles uri's with "url(" + URI + ")"
spec is ambigous about what a <uri-specification> is
Revision Changes Path
1.22 +16 -2 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.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- FopImageFactory.java 2001/07/30 20:29:26 1.21
+++ FopImageFactory.java 2001/09/07 13:56:23 1.22
@@ -1,5 +1,5 @@
/*
- * $Id: FopImageFactory.java,v 1.21 2001/07/30 20:29:26 tore Exp $
+ * $Id: FopImageFactory.java,v 1.22 2001/09/07 13:56:23 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.
@@ -17,7 +17,6 @@
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 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) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]