]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
doesn't open stream if image already loaded and in hash map
authorKeiron Liddle <keiron@apache.org>
Mon, 3 Dec 2001 07:57:40 +0000 (07:57 +0000)
committerKeiron Liddle <keiron@apache.org>
Mon, 3 Dec 2001 07:57:40 +0000 (07:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_20_2-maintain@194585 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/image/FopImageFactory.java

index 908abcf3ba341c55e60a99b29feea4b8768b9b86..305bc35d177e7e8309640c4d5d9eb84e75b07576 100644 (file)
@@ -58,6 +58,12 @@ public class FopImageFactory {
                 href = href.substring(1, href.length() - 1);
             }
         }
+
+        // check if already created
+        FopImage imageObject = (FopImage)m_urlMap.get(href);
+        if (imageObject != null)
+            return imageObject;
+
         try {
             // try url as complete first, this can cause
             // a problem with relative uri's if there is an
@@ -94,11 +100,6 @@ public class FopImageFactory {
             }
         }
 
-        // check if already created
-        FopImage imageObject = (FopImage)m_urlMap.get(absoluteURL.toString());
-        if (imageObject != null)
-            return imageObject;
-
             // If not, check image type
         ImageReader imgReader = null;
         try {
@@ -192,7 +193,7 @@ public class FopImageFactory {
                                         + "class " + imageClass.getName()
                                         + " doesn't implement org.apache.fop.image.FopImage interface");
         }
-        m_urlMap.put(absoluteURL.toString(), imageInstance);
+        m_urlMap.put(href, imageInstance);
         return (FopImage)imageInstance;
     }