You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by vh...@apache.org on 2013/03/19 17:10:11 UTC
svn commit: r1458373 -
/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/ImageManager.java
Author: vhennebert
Date: Tue Mar 19 16:10:11 2013
New Revision: 1458373
URL: http://svn.apache.org/r1458373
Log:
XGC-82: provide a way to close the resources associated to an image without fully loading it
Modified:
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/ImageManager.java
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/ImageManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/ImageManager.java?rev=1458373&r1=1458372&r2=1458373&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/ImageManager.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/ImageManager.java Tue Mar 19 16:10:11 2013
@@ -314,6 +314,18 @@ public class ImageManager {
}
/**
+ * Closes the resources associated to the given image. This method should be
+ * used only when none of the {@code getImage} methods is called by the
+ * client application.
+ *
+ * @param uri the URI of the image
+ * @param session the session context that was used to resolve the URI
+ */
+ public void closeImage(String uri, ImageSessionContext session) {
+ XmlSourceUtil.closeQuietly(session.getSource(uri));
+ }
+
+ /**
* Converts an image. The caller can indicate what kind of image flavors are requested. When
* this method is called the code looks for a suitable combination of ImageConverters so it
* can return the image in exactly the form the caller needs.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org