xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r605222 [2/3] - in /xmlgraphics/commons/branches/TempNewImagePackage: ./ lib/ src/java/org/apache/xmlgraphics/image/loader/ src/java/org/apache/xmlgraphics/image/loader/cache/ src/java/org/apache/xmlgraphics/image/loader/impl/ src/java/org/...
Date Tue, 18 Dec 2007 15:03:51 GMT
Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/ImageLoaderFactoryImageIO.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/ImageLoaderFactoryImageIO.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/ImageLoaderFactoryImageIO.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/ImageLoaderFactoryImageIO.java Tue Dec 18 07:03:41 2007
@@ -17,13 +17,13 @@
 
 /* $Id$ */
 
-package org.apache.fop.image2.impl.imageio;
+package org.apache.xmlgraphics.image.loader.impl.imageio;
 
 import javax.imageio.ImageIO;
 
-import org.apache.fop.image2.ImageFlavor;
-import org.apache.fop.image2.impl.AbstractImageLoaderFactory;
-import org.apache.fop.image2.spi.ImageLoader;
+import org.apache.xmlgraphics.image.loader.ImageFlavor;
+import org.apache.xmlgraphics.image.loader.impl.AbstractImageLoaderFactory;
+import org.apache.xmlgraphics.image.loader.spi.ImageLoader;
 
 /**
  * Factory class for the ImageLoader based on ImageIO.

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/ImageLoaderImageIO.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/ImageLoaderImageIO.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/ImageLoaderImageIO.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/ImageLoaderImageIO.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id$ */
 
-package org.apache.fop.image2.impl.imageio;
+package org.apache.xmlgraphics.image.loader.impl.imageio;
 
 import java.awt.Color;
 import java.awt.image.BufferedImage;
@@ -44,15 +44,15 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import org.apache.fop.image2.Image;
-import org.apache.fop.image2.ImageException;
-import org.apache.fop.image2.ImageFlavor;
-import org.apache.fop.image2.ImageInfo;
-import org.apache.fop.image2.ImageSessionContext;
-import org.apache.fop.image2.impl.AbstractImageLoader;
-import org.apache.fop.image2.impl.ImageBuffered;
-import org.apache.fop.image2.impl.ImageRendered;
-import org.apache.fop.image2.util.ImageUtil;
+import org.apache.xmlgraphics.image.loader.Image;
+import org.apache.xmlgraphics.image.loader.ImageException;
+import org.apache.xmlgraphics.image.loader.ImageFlavor;
+import org.apache.xmlgraphics.image.loader.ImageInfo;
+import org.apache.xmlgraphics.image.loader.ImageSessionContext;
+import org.apache.xmlgraphics.image.loader.impl.AbstractImageLoader;
+import org.apache.xmlgraphics.image.loader.impl.ImageBuffered;
+import org.apache.xmlgraphics.image.loader.impl.ImageRendered;
+import org.apache.xmlgraphics.image.loader.util.ImageUtil;
 
 /**
  * An ImageLoader implementation based on ImageIO for loading bitmap images.

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/PreloaderImageIO.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/PreloaderImageIO.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/PreloaderImageIO.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/PreloaderImageIO.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id$ */
  
-package org.apache.fop.image2.impl.imageio;
+package org.apache.xmlgraphics.image.loader.impl.imageio;
 
 import java.io.IOException;
 import java.util.Iterator;
@@ -28,12 +28,12 @@
 import javax.imageio.stream.ImageInputStream;
 import javax.xml.transform.Source;
 
-import org.apache.fop.image2.ImageContext;
-import org.apache.fop.image2.ImageException;
-import org.apache.fop.image2.ImageInfo;
-import org.apache.fop.image2.ImageSize;
-import org.apache.fop.image2.impl.AbstractImagePreloader;
-import org.apache.fop.image2.util.ImageUtil;
+import org.apache.xmlgraphics.image.loader.ImageContext;
+import org.apache.xmlgraphics.image.loader.ImageException;
+import org.apache.xmlgraphics.image.loader.ImageInfo;
+import org.apache.xmlgraphics.image.loader.ImageSize;
+import org.apache.xmlgraphics.image.loader.impl.AbstractImagePreloader;
+import org.apache.xmlgraphics.image.loader.util.ImageUtil;
 
 /**
  * Image preloader for images supported by ImageIO.

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/pipeline/ImageConversionEdge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/pipeline/ImageConversionEdge.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/pipeline/ImageConversionEdge.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/pipeline/ImageConversionEdge.java Tue Dec 18 07:03:41 2007
@@ -17,11 +17,11 @@
 
 /* $Id$ */
 
-package org.apache.fop.image2.pipeline;
+package org.apache.xmlgraphics.image.loader.pipeline;
 
-import org.apache.fop.image2.spi.ImageConverter;
-import org.apache.fop.util.dijkstra.Edge;
-import org.apache.fop.util.dijkstra.Vertex;
+import org.apache.xmlgraphics.image.loader.spi.ImageConverter;
+import org.apache.xmlgraphics.util.dijkstra.Edge;
+import org.apache.xmlgraphics.util.dijkstra.Vertex;
 
 /**
  * Represents an image conversion. The class basically wraps an ImageConverter so it can be

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/pipeline/ImageProviderPipeline.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/pipeline/ImageProviderPipeline.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/pipeline/ImageProviderPipeline.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/pipeline/ImageProviderPipeline.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id$ */
  
-package org.apache.fop.image2.pipeline;
+package org.apache.xmlgraphics.image.loader.pipeline;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -32,15 +32,15 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import org.apache.fop.image2.Image;
-import org.apache.fop.image2.ImageException;
-import org.apache.fop.image2.ImageFlavor;
-import org.apache.fop.image2.ImageInfo;
-import org.apache.fop.image2.ImageSessionContext;
-import org.apache.fop.image2.cache.ImageCache;
-import org.apache.fop.image2.impl.ImageRawStream;
-import org.apache.fop.image2.spi.ImageConverter;
-import org.apache.fop.image2.spi.ImageLoader;
+import org.apache.xmlgraphics.image.loader.Image;
+import org.apache.xmlgraphics.image.loader.ImageException;
+import org.apache.xmlgraphics.image.loader.ImageFlavor;
+import org.apache.xmlgraphics.image.loader.ImageInfo;
+import org.apache.xmlgraphics.image.loader.ImageSessionContext;
+import org.apache.xmlgraphics.image.loader.cache.ImageCache;
+import org.apache.xmlgraphics.image.loader.impl.ImageRawStream;
+import org.apache.xmlgraphics.image.loader.spi.ImageConverter;
+import org.apache.xmlgraphics.image.loader.spi.ImageLoader;
 
 /**
  * Represents a pipeline of ImageConverters with an ImageLoader at the beginning of the

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/pipeline/ImageRepresentation.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/pipeline/ImageRepresentation.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/pipeline/ImageRepresentation.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/pipeline/ImageRepresentation.java Tue Dec 18 07:03:41 2007
@@ -17,10 +17,10 @@
 
 /* $Id$ */
 
-package org.apache.fop.image2.pipeline;
+package org.apache.xmlgraphics.image.loader.pipeline;
 
-import org.apache.fop.image2.ImageFlavor;
-import org.apache.fop.util.dijkstra.Vertex;
+import org.apache.xmlgraphics.image.loader.ImageFlavor;
+import org.apache.xmlgraphics.util.dijkstra.Vertex;
 
 /**
  * This class represents a combination of MIME type and an image flavor.

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/pipeline/PipelineFactory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/pipeline/PipelineFactory.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/pipeline/PipelineFactory.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/pipeline/PipelineFactory.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id$ */
  
-package org.apache.fop.image2.pipeline;
+package org.apache.xmlgraphics.image.loader.pipeline;
 
 import java.util.Collection;
 import java.util.Comparator;
@@ -28,18 +28,18 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import org.apache.fop.image2.Image;
-import org.apache.fop.image2.ImageFlavor;
-import org.apache.fop.image2.ImageInfo;
-import org.apache.fop.image2.ImageManager;
-import org.apache.fop.image2.impl.CompositeImageLoader;
-import org.apache.fop.image2.spi.ImageConverter;
-import org.apache.fop.image2.spi.ImageImplRegistry;
-import org.apache.fop.image2.spi.ImageLoader;
-import org.apache.fop.image2.spi.ImageLoaderFactory;
-import org.apache.fop.util.dijkstra.DefaultEdgeDirectory;
-import org.apache.fop.util.dijkstra.DijkstraAlgorithm;
-import org.apache.fop.util.dijkstra.Vertex;
+import org.apache.xmlgraphics.image.loader.Image;
+import org.apache.xmlgraphics.image.loader.ImageFlavor;
+import org.apache.xmlgraphics.image.loader.ImageInfo;
+import org.apache.xmlgraphics.image.loader.ImageManager;
+import org.apache.xmlgraphics.image.loader.impl.CompositeImageLoader;
+import org.apache.xmlgraphics.image.loader.spi.ImageConverter;
+import org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry;
+import org.apache.xmlgraphics.image.loader.spi.ImageLoader;
+import org.apache.xmlgraphics.image.loader.spi.ImageLoaderFactory;
+import org.apache.xmlgraphics.util.dijkstra.DefaultEdgeDirectory;
+import org.apache.xmlgraphics.util.dijkstra.DijkstraAlgorithm;
+import org.apache.xmlgraphics.util.dijkstra.Vertex;
 
 /**
  * Factory class for image processing pipelines.

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImageConverter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImageConverter.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImageConverter.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImageConverter.java Tue Dec 18 07:03:41 2007
@@ -17,14 +17,14 @@
 
 /* $Id$ */
  
-package org.apache.fop.image2.spi;
+package org.apache.xmlgraphics.image.loader.spi;
 
 import java.io.IOException;
 import java.util.Map;
 
-import org.apache.fop.image2.Image;
-import org.apache.fop.image2.ImageException;
-import org.apache.fop.image2.ImageFlavor;
+import org.apache.xmlgraphics.image.loader.Image;
+import org.apache.xmlgraphics.image.loader.ImageException;
+import org.apache.xmlgraphics.image.loader.ImageFlavor;
 
 /**
  * Defines an image converter that can convert one image representation into another.

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImageImplRegistry.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImageImplRegistry.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImageImplRegistry.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImageImplRegistry.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id$ */
  
-package org.apache.fop.image2.spi;
+package org.apache.xmlgraphics.image.loader.spi;
 
 import java.util.Collection;
 import java.util.Collections;
@@ -29,10 +29,10 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.xmlgraphics.util.Service;
 
-import org.apache.fop.image2.ImageFlavor;
-import org.apache.fop.image2.ImageInfo;
+import org.apache.xmlgraphics.image.loader.ImageFlavor;
+import org.apache.xmlgraphics.image.loader.ImageInfo;
+import org.apache.xmlgraphics.util.Service;
 
 /**
  * This class is the registry for all implementations of the various service provider interfaces

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImageLoader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImageLoader.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImageLoader.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImageLoader.java Tue Dec 18 07:03:41 2007
@@ -17,16 +17,16 @@
 
 /* $Id$ */
  
-package org.apache.fop.image2.spi;
+package org.apache.xmlgraphics.image.loader.spi;
 
 import java.io.IOException;
 import java.util.Map;
 
-import org.apache.fop.image2.Image;
-import org.apache.fop.image2.ImageException;
-import org.apache.fop.image2.ImageFlavor;
-import org.apache.fop.image2.ImageInfo;
-import org.apache.fop.image2.ImageSessionContext;
+import org.apache.xmlgraphics.image.loader.Image;
+import org.apache.xmlgraphics.image.loader.ImageException;
+import org.apache.xmlgraphics.image.loader.ImageFlavor;
+import org.apache.xmlgraphics.image.loader.ImageInfo;
+import org.apache.xmlgraphics.image.loader.ImageSessionContext;
 
 /**
  * This interface is implemented by classes which load images from a source. Normally, such a

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImageLoaderFactory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImageLoaderFactory.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImageLoaderFactory.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImageLoaderFactory.java Tue Dec 18 07:03:41 2007
@@ -17,10 +17,10 @@
 
 /* $Id$ */
 
-package org.apache.fop.image2.spi;
+package org.apache.xmlgraphics.image.loader.spi;
 
-import org.apache.fop.image2.ImageFlavor;
-import org.apache.fop.image2.ImageInfo;
+import org.apache.xmlgraphics.image.loader.ImageFlavor;
+import org.apache.xmlgraphics.image.loader.ImageInfo;
 
 /**
  * This interface is implemented to provide information about an ImageLoader and to create new

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImagePreloader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImagePreloader.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImagePreloader.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/spi/ImagePreloader.java Tue Dec 18 07:03:41 2007
@@ -17,15 +17,15 @@
 
 /* $Id$ */
  
-package org.apache.fop.image2.spi;
+package org.apache.xmlgraphics.image.loader.spi;
 
 import java.io.IOException;
 
 import javax.xml.transform.Source;
 
-import org.apache.fop.image2.ImageContext;
-import org.apache.fop.image2.ImageException;
-import org.apache.fop.image2.ImageInfo;
+import org.apache.xmlgraphics.image.loader.ImageContext;
+import org.apache.xmlgraphics.image.loader.ImageException;
+import org.apache.xmlgraphics.image.loader.ImageInfo;
 
 /**
  * This interface provides two functions: determining whether an image format is supported and if

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/ImageInputStreamAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/ImageInputStreamAdapter.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/ImageInputStreamAdapter.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/ImageInputStreamAdapter.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id$ */
 
-package org.apache.fop.image2.util;
+package org.apache.xmlgraphics.image.loader.util;
 
 import java.io.IOException;
 import java.io.InputStream;

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/ImageUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/ImageUtil.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/ImageUtil.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/ImageUtil.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id$ */
 
-package org.apache.fop.image2.util;
+package org.apache.xmlgraphics.image.loader.util;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -35,9 +35,9 @@
 
 import org.apache.commons.io.IOUtils;
 
-import org.apache.fop.image2.ImageProcessingHints;
-import org.apache.fop.image2.ImageSessionContext;
-import org.apache.fop.image2.ImageSource;
+import org.apache.xmlgraphics.image.loader.ImageProcessingHints;
+import org.apache.xmlgraphics.image.loader.ImageSessionContext;
+import org.apache.xmlgraphics.image.loader.ImageSource;
 
 /**
  * Helper and convenience methods for working with the image package.

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/SeekableStreamAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/SeekableStreamAdapter.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/SeekableStreamAdapter.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/SeekableStreamAdapter.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id$ */
  
-package org.apache.fop.image2.util;
+package org.apache.xmlgraphics.image.loader.util;
 
 import java.io.IOException;
 

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/SoftMapCache.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/SoftMapCache.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/SoftMapCache.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/SoftMapCache.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id$ */
  
-package org.apache.fop.image2.util;
+package org.apache.xmlgraphics.image.loader.util;
 
 import java.lang.ref.Reference;
 import java.lang.ref.ReferenceQueue;

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/SoftReferenceWithKey.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/SoftReferenceWithKey.java?rev=605222&r1=605147&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/SoftReferenceWithKey.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/image/loader/util/SoftReferenceWithKey.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id$ */
  
-package org.apache.fop.image2.util;
+package org.apache.xmlgraphics.image.loader.util;
 
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.SoftReference;

Copied: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/java2d/CMYKColorSpace.java (from r605204, xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/util/CMYKColorSpace.java)
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/java2d/CMYKColorSpace.java?p2=xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/java2d/CMYKColorSpace.java&p1=xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/util/CMYKColorSpace.java&r1=605204&r2=605222&rev=605222&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/util/CMYKColorSpace.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/java2d/CMYKColorSpace.java Tue Dec 18 07:03:41 2007
@@ -17,16 +17,17 @@
 
 /* $Id$ */
  
-package org.apache.fop.util;
+package org.apache.xmlgraphics.java2d;
 
 import java.awt.color.ColorSpace;
 
 /**
- * This class represents an uncalibrated CMYK color space. It is used by
- * the JpegImage class.
+ * This class represents an uncalibrated CMYK color space.
  */
 public class CMYKColorSpace extends ColorSpace {
 
+    private static final long serialVersionUID = 2925508946083542974L;
+    
     private static CMYKColorSpace instance;
 
     /**
@@ -47,9 +48,7 @@
         return instance;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    /** {@inheritDoc} */
     public float[] toRGB(float[] colorvalue) {
         return new float [] {
             (1 - colorvalue[0]) * (1 - colorvalue[3]),
@@ -57,23 +56,17 @@
             (1 - colorvalue[2]) * (1 - colorvalue[3])};
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    /** {@inheritDoc} */
     public float[] fromRGB(float[] rgbvalue) {
         throw new UnsupportedOperationException("NYI");
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    /** {@inheritDoc} */
     public float[] toCIEXYZ(float[] colorvalue) {
         throw new UnsupportedOperationException("NYI");
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    /** {@inheritDoc} */
     public float[] fromCIEXYZ(float[] colorvalue) {
         throw new UnsupportedOperationException("NYI");
     }

Copied: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/java2d/Graphics2DImagePainter.java (from r605202, xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/Graphics2DImagePainter.java)
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/java2d/Graphics2DImagePainter.java?p2=xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/java2d/Graphics2DImagePainter.java&p1=xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/Graphics2DImagePainter.java&r1=605202&r2=605222&rev=605222&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/Graphics2DImagePainter.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/java2d/Graphics2DImagePainter.java Tue Dec 18 07:03:41 2007
@@ -17,15 +17,15 @@
 
 /* $Id$ */
  
-package org.apache.fop.render;
+package org.apache.xmlgraphics.java2d;
 
 import java.awt.Dimension;
 import java.awt.Graphics2D;
 import java.awt.geom.Rectangle2D;
 
 /**
- * This interface is used by the Graphics2DAdapter. Components that can paint using
- * a Graphics2D instance can implement this interface to paint themselves.
+ * This interface is used to paint vector graphic images. Components that can paint using
+ * a Graphics2D instance (i.e. Java2D) can implement this interface to paint themselves.
  */
 public interface Graphics2DImagePainter {
 
@@ -33,12 +33,12 @@
      * Called to paint the image. Implementations should scale so the image is
      * painted fully inside the given area indicated by then Rectangle2D object.
      * @param g2d the Graphics2D instance to paint on
-     * @param area the target area for the image (values are in points)
+     * @param area the target area for the image (in target device units)
      */
     void paint(Graphics2D g2d, Rectangle2D area);
 
     /**
-     * @return the dimensions of the image to be painted in millipoints
+     * @return the dimensions (intrinsic size) of the image to be painted in millipoints
      */
     Dimension getImageSize();
     

Copied: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/MimeConstants.java (from r605201, xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/apps/MimeConstants.java)
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/MimeConstants.java?p2=xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/MimeConstants.java&p1=xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/apps/MimeConstants.java&r1=605201&r2=605222&rev=605222&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/apps/MimeConstants.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/MimeConstants.java Tue Dec 18 07:03:41 2007
@@ -17,10 +17,10 @@
 
 /* $Id$ */
 
-package org.apache.fop.apps;
+package org.apache.xmlgraphics.util;
 
 /**
- * Frequently used MIME types for various file formats used when working with Apache FOP.
+ * Frequently used MIME types for various file formats used by the XML Graphics project.
  */
 public interface MimeConstants {
 
@@ -67,13 +67,6 @@
     /** TIFF images */
     String MIME_TIFF            = "image/tiff";
        
-    /** Apache FOP's AWT preview (non-standard MIME type) */
-    String MIME_FOP_AWT_PREVIEW = "application/X-fop-awt-preview";
-    /** Apache FOP's Direct Printing (non-standard MIME type) */
-    String MIME_FOP_PRINT       = "application/X-fop-print";
-    /** Apache FOP's area tree XML */
-    String MIME_FOP_AREA_TREE   = "application/X-fop-areatree";
-
     /** Proposed but non-registered MIME type for XSL-FO */
     String MIME_XSL_FO          = "text/xsl";
     

Copied: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/UnitConv.java (from r605201, xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/util/UnitConv.java)
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/UnitConv.java?p2=xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/UnitConv.java&p1=xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/util/UnitConv.java&r1=605201&r2=605222&rev=605222&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/util/UnitConv.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/UnitConv.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id: FixedLength.java 279656 2005-09-08 22:06:48Z pietsch $ */
 
-package org.apache.fop.util;
+package org.apache.xmlgraphics.util;
 
 /**
  * Utility class for unit conversions.

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/DefaultEdgeDirectory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/DefaultEdgeDirectory.java?rev=605222&r1=605151&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/DefaultEdgeDirectory.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/DefaultEdgeDirectory.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id$ */
 
-package org.apache.fop.util.dijkstra;
+package org.apache.xmlgraphics.util.dijkstra;
 
 import java.util.Collections;
 import java.util.Iterator;

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/DijkstraAlgorithm.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/DijkstraAlgorithm.java?rev=605222&r1=605151&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/DijkstraAlgorithm.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/DijkstraAlgorithm.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id$ */
 
-package org.apache.fop.util.dijkstra;
+package org.apache.xmlgraphics.util.dijkstra;
 
 import java.util.Comparator;
 import java.util.Iterator;

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/Edge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/Edge.java?rev=605222&r1=605151&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/Edge.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/Edge.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id$ */
 
-package org.apache.fop.util.dijkstra;
+package org.apache.xmlgraphics.util.dijkstra;
 
 /**
  * Represents an edge (or direct route between two points) for the {@link DijkstraAlgorithm}.

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/EdgeDirectory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/EdgeDirectory.java?rev=605222&r1=605151&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/EdgeDirectory.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/EdgeDirectory.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id$ */
 
-package org.apache.fop.util.dijkstra;
+package org.apache.xmlgraphics.util.dijkstra;
 
 import java.util.Iterator;
 

Modified: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/Vertex.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/Vertex.java?rev=605222&r1=605151&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/Vertex.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/Vertex.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id$ */
 
-package org.apache.fop.util.dijkstra;
+package org.apache.xmlgraphics.util.dijkstra;
 
 /**
  * Represents a vertex to be used by {@link DijkstraAlgorithm}. If you want to represent a city,

Added: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/package.html
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/package.html?rev=605222&view=auto
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/package.html (added)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/package.html Tue Dec 18 07:03:41 2007
@@ -0,0 +1,26 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id$ -->
+<HTML>
+<TITLE>org.apache.xmlgraphics.util.dijkstra Package</TITLE>
+<BODY>
+<P>
+  Contains an implementation of Dijkstra's shortest path algorithm. The package is primarily used
+  by the image loader package (org.apache.xmlgraphics.image.loader).
+</P>
+</BODY>
+</HTML>
\ No newline at end of file

Propchange: xmlgraphics/commons/branches/TempNewImagePackage/src/java/org/apache/xmlgraphics/util/dijkstra/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: xmlgraphics/commons/branches/TempNewImagePackage/src/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageConverter
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageConverter?rev=605222&view=auto
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageConverter (added)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageConverter Tue Dec 18 07:03:41 2007
@@ -0,0 +1,4 @@
+org.apache.xmlgraphics.image.loader.impl.ImageConverterBuffered2Rendered
+org.apache.xmlgraphics.image.loader.impl.ImageConverterG2D2Bitmap
+org.apache.xmlgraphics.image.loader.impl.ImageConverterBitmap2G2D
+org.apache.xmlgraphics.image.loader.impl.ImageConverterRendered2PNG
\ No newline at end of file

Added: xmlgraphics/commons/branches/TempNewImagePackage/src/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageLoaderFactory
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageLoaderFactory?rev=605222&view=auto
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageLoaderFactory (added)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageLoaderFactory Tue Dec 18 07:03:41 2007
@@ -0,0 +1,4 @@
+org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderFactoryImageIO
+org.apache.xmlgraphics.image.loader.impl.ImageLoaderFactoryRaw
+org.apache.xmlgraphics.image.loader.impl.ImageLoaderFactoryRawCCITTFax
+org.apache.xmlgraphics.image.loader.impl.ImageLoaderFactoryEPS
\ No newline at end of file

Added: xmlgraphics/commons/branches/TempNewImagePackage/src/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImagePreloader
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/src/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImagePreloader?rev=605222&view=auto
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/src/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImagePreloader (added)
+++ xmlgraphics/commons/branches/TempNewImagePackage/src/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImagePreloader Tue Dec 18 07:03:41 2007
@@ -0,0 +1,7 @@
+org.apache.xmlgraphics.image.loader.impl.PreloaderTIFF
+org.apache.xmlgraphics.image.loader.impl.PreloaderGIF
+org.apache.xmlgraphics.image.loader.impl.PreloaderJPEG
+org.apache.xmlgraphics.image.loader.impl.PreloaderBMP
+org.apache.xmlgraphics.image.loader.impl.PreloaderEMF
+org.apache.xmlgraphics.image.loader.impl.PreloaderEPS
+org.apache.xmlgraphics.image.loader.impl.imageio.PreloaderImageIO
\ No newline at end of file

Modified: xmlgraphics/commons/branches/TempNewImagePackage/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/status.xml?rev=605222&r1=605221&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/status.xml (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/status.xml Tue Dec 18 07:03:41 2007
@@ -25,6 +25,10 @@
 	</todo>
 	<changes>
 		<release version="Trunk" date="n/a">
+		  <action context="Code" dev="JM" type="add">
+		    The package org.apache.xmlgraphics.image.loader was added. It contains a general
+		    image loading framework for various image formats (bitmap &amp; vector).
+		  </action>
 		  <action context="Code" dev="JM" type="update">
 		    PostScript: Improved PSImageUtils by introducing the ImageEncoder interface and
 		    allowing for streams instead of byte arrays for data transfer which can lower

Added: xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/DemoPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/DemoPainter.java?rev=605222&view=auto
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/DemoPainter.java (added)
+++ xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/DemoPainter.java Tue Dec 18 07:03:41 2007
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.xmlgraphics.image.loader;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.geom.Rectangle2D;
+
+import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
+
+public class DemoPainter implements Graphics2DImagePainter {
+
+    /** {@inheritDoc} */
+    public Dimension getImageSize() {
+        return new Dimension(10000, 10000);
+    }
+
+    public void paint(Graphics2D g2d, Rectangle2D area) {
+        double w = area.getWidth();
+        double h = area.getHeight();
+
+        //Fit in paint area
+        Dimension imageSize = getImageSize();
+        double sx = w / imageSize.getWidth();
+        double sy = h / imageSize.getHeight();
+        if (sx != 1.0 || sy != 1.0) {
+            g2d.scale(sx, sy);
+        }
+
+        g2d.setColor(Color.BLACK);
+        g2d.setStroke(new BasicStroke());
+        g2d.drawRect(0, 0, imageSize.width, imageSize.height);
+        g2d.drawOval(0, 0, imageSize.width, imageSize.height);
+    }
+
+}

Propchange: xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/DemoPainter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/DemoPainter.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/ImageLoaderTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/ImageLoaderTestCase.java?rev=605222&r1=605206&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/ImageLoaderTestCase.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/ImageLoaderTestCase.java Tue Dec 18 07:03:41 2007
@@ -17,9 +17,8 @@
 
 /* $Id$ */
 
-package org.apache.fop.image2;
+package org.apache.xmlgraphics.image.loader;
 
-import java.io.File;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.Reader;
@@ -27,41 +26,31 @@
 import junit.framework.TestCase;
 
 import org.apache.commons.io.IOUtils;
-import org.apache.xmlgraphics.image.writer.ImageWriterUtil;
 
-import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.apps.FopFactory;
-import org.apache.fop.image2.impl.ImageRawStream;
-import org.apache.fop.image2.impl.ImageRendered;
-import org.apache.fop.image2.impl.ImageXMLDOM;
+import org.apache.xmlgraphics.image.loader.impl.ImageRawStream;
+import org.apache.xmlgraphics.image.loader.impl.ImageRendered;
 
 /**
  * Tests for bundled ImageLoader implementations.
  */
 public class ImageLoaderTestCase extends TestCase {
 
-    private static final File DEBUG_TARGET_DIR = null; //new File("D:/");
-    
-    private FopFactory fopFactory;
+    private MockImageContext imageContext = MockImageContext.getInstance();
     
     public ImageLoaderTestCase(String name) {
         super(name);
-        fopFactory = FopFactory.newInstance();
-        fopFactory.setSourceResolution(72);
-        fopFactory.setTargetResolution(300);
     }
     
     public void testPNG() throws Exception {
-        String uri = "examples/fo/graphics/asf-logo.png";
-        
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
+        String uri = "asf-logo.png";
         
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
+
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
         
-        Image img = manager.getImage(info, ImageFlavor.RENDERED_IMAGE, 
-                userAgent.getImageSessionContext());
+        Image img = manager.getImage(info, ImageFlavor.RENDERED_IMAGE, sessionContext);
         assertNotNull("Image must not be null", img);
         assertEquals(ImageFlavor.RENDERED_IMAGE, img.getFlavor());
         ImageRendered imgRed = (ImageRendered)img;
@@ -74,16 +63,15 @@
     }
     
     public void testGIF() throws Exception {
-        String uri = "test/resources/images/bgimg72dpi.gif";
+        String uri = "bgimg72dpi.gif";
         
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
-        
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
+
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
         
-        Image img = manager.getImage(info, ImageFlavor.RENDERED_IMAGE, 
-                userAgent.getImageSessionContext());
+        Image img = manager.getImage(info, ImageFlavor.RENDERED_IMAGE, sessionContext);
         assertNotNull("Image must not be null", img);
         assertEquals(ImageFlavor.RENDERED_IMAGE, img.getFlavor());
         ImageRendered imgRed = (ImageRendered)img;
@@ -95,82 +83,16 @@
         assertEquals(192000, info.getSize().getHeightMpt());
     }
     
-    public void testSVG() throws Exception {
-        String uri = "test/resources/images/img-w-size.svg";
-        
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
-        
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
-        assertNotNull("ImageInfo must not be null", info);
-        
-        Image img = manager.getImage(info, ImageFlavor.XML_DOM, 
-                userAgent.getImageSessionContext());
-        assertNotNull("Image must not be null", img);
-        assertEquals(ImageFlavor.XML_DOM, img.getFlavor());
-        ImageXMLDOM imgDom = (ImageXMLDOM)img;
-        assertNotNull(imgDom.getDocument());
-        assertEquals("http://www.w3.org/2000/svg", imgDom.getRootNamespace());
-        info = imgDom.getInfo(); //Switch to the ImageInfo returned by the image
-        assertEquals(16000, info.getSize().getWidthMpt());
-        assertEquals(16000, info.getSize().getHeightMpt());
-        
-        img = manager.getImage(info, ImageFlavor.RENDERED_IMAGE,
-                    userAgent.getImageSessionContext());
-        assertNotNull("Image must not be null", img);
-        assertEquals(ImageFlavor.RENDERED_IMAGE, img.getFlavor());
-        ImageRendered imgRed = (ImageRendered)img;
-        assertNotNull(imgRed.getRenderedImage());
-        if (DEBUG_TARGET_DIR != null) {
-            ImageWriterUtil.saveAsPNG(imgRed.getRenderedImage(),
-                    (int)userAgent.getTargetResolution(),
-                    new File(DEBUG_TARGET_DIR, "out.svg.png"));
-        }
-        assertEquals(67, imgRed.getRenderedImage().getWidth());
-        assertEquals(67, imgRed.getRenderedImage().getHeight());
-        info = imgRed.getInfo(); //Switch to the ImageInfo returned by the image
-        assertEquals(16000, info.getSize().getWidthMpt());
-        assertEquals(16000, info.getSize().getHeightMpt());
-    }
-    
-    public void testWMF() throws Exception {
-        String uri = "test/resources/images/testChart.wmf";
-        
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
-        
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
-        assertNotNull("ImageInfo must not be null", info);
-        
-        Image img = manager.getImage(info, ImageFlavor.RENDERED_IMAGE,
-                userAgent.getImageSessionContext());
-        assertNotNull("Image must not be null", img);
-        assertEquals(ImageFlavor.RENDERED_IMAGE, img.getFlavor());
-        ImageRendered imgRed = (ImageRendered)img;
-        assertNotNull(imgRed.getRenderedImage());
-        if (DEBUG_TARGET_DIR != null) {
-            ImageWriterUtil.saveAsPNG(imgRed.getRenderedImage(),
-                    (int)userAgent.getTargetResolution(),
-                    new File(DEBUG_TARGET_DIR, "out.wmf.png"));
-        }
-        assertEquals(3300, imgRed.getRenderedImage().getWidth());
-        assertEquals(2550, imgRed.getRenderedImage().getHeight());
-        info = imgRed.getInfo(); //Switch to the ImageInfo returned by the image
-        assertEquals(792000, info.getSize().getWidthMpt());
-        assertEquals(612000, info.getSize().getHeightMpt());
-    }
- 
     public void testEPSASCII() throws Exception {
-        String uri = "test/resources/images/barcode.eps";
+        String uri = "barcode.eps";
         
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
-        
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
+
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
         
-        Image img = manager.getImage(info, ImageFlavor.RAW_EPS,
-                userAgent.getImageSessionContext());
+        Image img = manager.getImage(info, ImageFlavor.RAW_EPS, sessionContext);
         assertNotNull("Image must not be null", img);
         assertEquals(ImageFlavor.RAW_EPS, img.getFlavor());
         ImageRawStream imgEPS = (ImageRawStream)img;
@@ -189,16 +111,15 @@
     }
  
     public void testEPSBinary() throws Exception {
-        String uri = "test/resources/images/img-with-tiff-preview.eps";
+        String uri = "img-with-tiff-preview.eps";
         
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
-        
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
+
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
         
-        Image img = manager.getImage(info, ImageFlavor.RAW_EPS,
-                userAgent.getImageSessionContext());
+        Image img = manager.getImage(info, ImageFlavor.RAW_EPS, sessionContext);
         assertNotNull("Image must not be null", img);
         assertEquals(ImageFlavor.RAW_EPS, img.getFlavor());
         ImageRawStream imgEPS = (ImageRawStream)img;

Modified: xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/ImagePipelineTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/ImagePipelineTestCase.java?rev=605222&r1=605206&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/ImagePipelineTestCase.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/ImagePipelineTestCase.java Tue Dec 18 07:03:41 2007
@@ -17,114 +17,102 @@
 
 /* $Id$ */
 
-package org.apache.fop.image2;
+package org.apache.xmlgraphics.image.loader;
 
+import java.awt.Dimension;
 import java.io.File;
-import java.io.IOException;
 
 import junit.framework.TestCase;
 
-import org.w3c.dom.svg.SVGDocument;
-
-import org.apache.batik.dom.svg.SAXSVGDocumentFactory;
-
-import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.apps.FopFactory;
-import org.apache.fop.image2.impl.ImageConverterBuffered2Rendered;
-import org.apache.fop.image2.impl.ImageConverterG2D2Bitmap;
-import org.apache.fop.image2.impl.ImageConverterRendered2PNG;
-import org.apache.fop.image2.impl.ImageRawStream;
-import org.apache.fop.image2.impl.ImageXMLDOM;
-import org.apache.fop.image2.impl.batik.ImageConverterSVG2G2D;
-import org.apache.fop.image2.impl.batik.PreloaderSVG;
-import org.apache.fop.image2.impl.imageio.ImageLoaderImageIO;
-import org.apache.fop.image2.pipeline.ImageProviderPipeline;
-import org.apache.fop.image2.spi.ImageLoader;
+import org.apache.xmlgraphics.image.loader.impl.ImageConverterBuffered2Rendered;
+import org.apache.xmlgraphics.image.loader.impl.ImageConverterG2D2Bitmap;
+import org.apache.xmlgraphics.image.loader.impl.ImageConverterRendered2PNG;
+import org.apache.xmlgraphics.image.loader.impl.ImageGraphics2D;
+import org.apache.xmlgraphics.image.loader.impl.ImageRawStream;
+import org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderImageIO;
+import org.apache.xmlgraphics.image.loader.pipeline.ImageProviderPipeline;
+import org.apache.xmlgraphics.image.loader.spi.ImageLoader;
+import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
 
 /**
  * Tests for the image pipeline functionality.
  */
 public class ImagePipelineTestCase extends TestCase {
 
-    private FopFactory fopFactory;
+    private MockImageContext imageContext = MockImageContext.getInstance();
     
     public ImagePipelineTestCase(String name) {
         super(name);
-        fopFactory = FopFactory.newInstance();
-        fopFactory.setSourceResolution(72);
-        fopFactory.setTargetResolution(300);
     }
     
     public void testPipelineWithLoader() throws Exception {
-        String uri = "test/resources/images/bgimg72dpi.gif";
+        String uri = "bgimg72dpi.gif";
 
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
-        ImageManager manager = fopFactory.getImageManager();
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
         
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
         
         ImageLoader loader = new ImageLoaderImageIO(ImageFlavor.RENDERED_IMAGE);
         ImageProviderPipeline pipeline = new ImageProviderPipeline(manager.getCache(), loader);
         pipeline.addConverter(new ImageConverterRendered2PNG());
         
-        Image img = pipeline.execute(info, null, userAgent.getImageSessionContext());
+        Image img = pipeline.execute(info, null, sessionContext);
         assertNotNull("Image must not be null", img);
         assertEquals(ImageFlavor.RAW_PNG, img.getFlavor());
         assertTrue(img instanceof ImageRawStream);
     }
     
-    private ImageXMLDOM createSVGImage() throws IOException {
-        File svgFile = new File("test/resources/images/img-w-size.svg");
-        SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(
-                PreloaderSVG.getParserName());
-        SVGDocument doc = (SVGDocument)factory.createSVGDocument(
-                svgFile.toURL().toExternalForm());
-        
-        //We simulate an instream-foreign-object where there is no original URI for the image.
-        //We also don't "know" the MIME type.
-        ImageInfo info = new ImageInfo(null /*null is the intention here*/, null);
-        info.setSize(new ImageSize(72, 72, 72));
-        info.getSize().calcSizeFromPixels();
-        
-        ImageXMLDOM svgImage = new ImageXMLDOM(info,
-                doc, doc.getDocumentElement().getNamespaceURI());
-        return svgImage;
-    }
-    
     public void testPipelineWithoutLoader() throws Exception {
 
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
-        ImageManager manager = fopFactory.getImageManager();
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
 
-        ImageXMLDOM svgImage = createSVGImage();
+        Image original = createG2DImage();
         
         ImageProviderPipeline pipeline = new ImageProviderPipeline(manager.getCache(), null);
-        pipeline.addConverter(new ImageConverterSVG2G2D());
         pipeline.addConverter(new ImageConverterG2D2Bitmap());
         pipeline.addConverter(new ImageConverterBuffered2Rendered());
         pipeline.addConverter(new ImageConverterRendered2PNG());
         
-        Image img = pipeline.execute(svgImage.getInfo(), svgImage, null,
-                    userAgent.getImageSessionContext());
+        Image img = pipeline.execute(original.getInfo(), original, null,
+                sessionContext);
         assertNotNull("Image must not be null", img);
         assertEquals(ImageFlavor.RAW_PNG, img.getFlavor());
         assertTrue(img instanceof ImageRawStream);
+        
+        ((ImageRawStream)img).writeTo(new File("D:/out.png"));
     }
     
-    public void testPipelineFromURIThroughManager() throws Exception {
-        String uri = "examples/fo/graphics/asf-logo.png";
+    private Image createG2DImage() {
+        Graphics2DImagePainter painter = new DemoPainter();
+        Dimension dim = painter.getImageSize();
+        
+        ImageSize size = new ImageSize();
+        size.setSizeInMillipoints(dim.width, dim.height);
+        size.setResolution(72);
+        size.calcPixelsFromSize();
         
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
-        ImageManager manager = fopFactory.getImageManager();
+        ImageInfo info = new ImageInfo(null /*null is the intention here*/, null);
+        info.setSize(size);
+        ImageGraphics2D g2dImage = new ImageGraphics2D(info, painter);
+        return g2dImage;
+    }
+
+    public void testPipelineFromURIThroughManager() throws Exception {
+        String uri = "asf-logo.png";
         
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
+
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
 
         ImageFlavor[] flavors = new ImageFlavor[] {
                 ImageFlavor.RAW_PNG, ImageFlavor.RAW_JPEG
         };
-        Image img = manager.getImage(info, flavors, userAgent.getImageSessionContext());
+        Image img = manager.getImage(info, flavors, sessionContext);
         
         assertNotNull("Image must not be null", img);
         assertEquals(ImageFlavor.RAW_PNG, img.getFlavor());
@@ -132,15 +120,14 @@
     }
     
     public void testPipelineWithoutURIThroughManager() throws Exception {
+        ImageManager manager = imageContext.getImageManager();
         
-        ImageManager manager = fopFactory.getImageManager();
-        
-        ImageXMLDOM svgImage = createSVGImage();
+        Image original = createG2DImage();
 
         ImageFlavor[] flavors = new ImageFlavor[] {
                 ImageFlavor.RAW_PNG, ImageFlavor.RAW_JPEG
         };
-        Image img = manager.convertImage(svgImage, flavors);
+        Image img = manager.convertImage(original, flavors);
         
         assertNotNull("Image must not be null", img);
         assertEquals(ImageFlavor.RAW_PNG, img.getFlavor());

Modified: xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/ImagePreloaderTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/ImagePreloaderTestCase.java?rev=605222&r1=605206&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/ImagePreloaderTestCase.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/ImagePreloaderTestCase.java Tue Dec 18 07:03:41 2007
@@ -17,35 +17,28 @@
 
 /* $Id$ */
 
-package org.apache.fop.image2;
+package org.apache.xmlgraphics.image.loader;
 
 import java.io.FileNotFoundException;
-import java.io.IOException;
 
 import junit.framework.TestCase;
 
-import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.apps.FopFactory;
-import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.image2.impl.batik.ImageWMF;
-import org.apache.fop.image2.spi.ImageLoaderFactory;
+import org.apache.xmlgraphics.image.loader.spi.ImageLoaderFactory;
+import org.apache.xmlgraphics.util.MimeConstants;
 
 /**
  * Tests for bundled Imagepreloader implementations.
  */
 public class ImagePreloaderTestCase extends TestCase {
 
-    private FopFactory fopFactory;
+    private MockImageContext imageContext = MockImageContext.getInstance();
     
     public ImagePreloaderTestCase(String name) {
         super(name);
-        fopFactory = FopFactory.newInstance();
-        fopFactory.setSourceResolution(72);
-        fopFactory.setTargetResolution(300);
     }
     
     public void testImageLoaderFactory() throws Exception {
-        ImageManager manager = fopFactory.getImageManager();
+        ImageManager manager = imageContext.getImageManager();
         ImageInfo info = new ImageInfo(null, MimeConstants.MIME_PNG);
         ImageLoaderFactory ilf = manager.getRegistry().getImageLoaderFactory(
                 info, ImageFlavor.BUFFERED_IMAGE);
@@ -55,10 +48,10 @@
     public void testFileNotFound() throws Exception {
         String uri = "doesnotexistanywhere.png";
         
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
-        ImageManager manager = fopFactory.getImageManager();
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
         try {
-            ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+            ImageInfo info = manager.preloadImage(uri, sessionContext);
             fail("Expected a FileNotFoundException!");
         } catch (FileNotFoundException e) {
             //expected!
@@ -66,15 +59,15 @@
     }
     
     public void testPNG() throws Exception {
-        String uri = "examples/fo/graphics/asf-logo.png";
+        String uri = "asf-logo.png";
         
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
         
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
         assertEquals(MimeConstants.MIME_PNG, info.getMimeType());
-        assertEquals("examples/fo/graphics/asf-logo.png", info.getOriginalURI());
+        assertEquals("asf-logo.png", info.getOriginalURI());
         assertEquals(169, info.getSize().getWidthPx());
         assertEquals(51, info.getSize().getHeightPx());
         assertEquals(96, info.getSize().getDpiHorizontal(), 0.1);
@@ -83,12 +76,12 @@
     }
     
     public void testTIFF() throws Exception {
-        String uri = "test/resources/images/tiff_group4.tif";
+        String uri = "tiff_group4.tif";
         
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
-        
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
+
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
         assertEquals(MimeConstants.MIME_TIFF, info.getMimeType());
         assertEquals(uri, info.getOriginalURI());
@@ -100,106 +93,46 @@
     }
     
     public void testTIFFNoResolution() throws Exception {
-        String uri = "test/resources/images/no-resolution.tif";
-        
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
+        String uri = "no-resolution.tif";
         
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
+
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
         assertEquals(MimeConstants.MIME_TIFF, info.getMimeType());
         assertEquals(uri, info.getOriginalURI());
         assertEquals(51, info.getSize().getWidthPx());
         assertEquals(24, info.getSize().getHeightPx());
-        assertEquals(userAgent.getSourceResolution(), info.getSize().getDpiHorizontal(), 0.1);
+        assertEquals(imageContext.getSourceResolution(), info.getSize().getDpiHorizontal(), 0.1);
         assertEquals(51000, info.getSize().getWidthMpt());
         assertEquals(24000, info.getSize().getHeightMpt());
     }
     
     public void testGIF() throws Exception {
-        String uri = "test/resources/images/bgimg72dpi.gif";
-        
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
+        String uri = "bgimg72dpi.gif";
         
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
+
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
         assertEquals(MimeConstants.MIME_GIF, info.getMimeType());
         assertEquals(uri, info.getOriginalURI());
         assertEquals(192, info.getSize().getWidthPx());
         assertEquals(192, info.getSize().getHeightPx());
-        assertEquals(userAgent.getSourceResolution(), info.getSize().getDpiHorizontal(), 0.1);
+        assertEquals(imageContext.getSourceResolution(), info.getSize().getDpiHorizontal(), 0.1);
         assertEquals(192000, info.getSize().getWidthMpt());
         assertEquals(192000, info.getSize().getHeightMpt());
     }
     
-    public void testSVG() throws Exception {
-        String uri = "test/resources/images/img-w-size.svg";
-        
-        checkSVGFile(uri);
-    }
-
-    public void testSVGZ() throws Exception {
-        String uri = "test/resources/images/img-w-size.svgz";
-        
-        checkSVGFile(uri);
-    }
-
-    private void checkSVGFile(String uri) throws ImageException, IOException {
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
-        
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
-        assertNotNull("ImageInfo must not be null", info);
-        assertEquals(MimeConstants.MIME_SVG, info.getMimeType());
-        assertEquals(uri, info.getOriginalURI());
-        assertEquals(16, info.getSize().getWidthPx());
-        assertEquals(16, info.getSize().getHeightPx());
-        assertEquals(userAgent.getSourceResolution(), info.getSize().getDpiHorizontal(), 0.1);
-        assertEquals(16000, info.getSize().getWidthMpt());
-        assertEquals(16000, info.getSize().getHeightMpt());
-    }
-    
-    public void testSVGNoSize() throws Exception {
-        String uri = "test/resources/images/img.svg";
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
-        
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
-        assertNotNull("ImageInfo must not be null", info);
-        assertEquals(MimeConstants.MIME_SVG, info.getMimeType());
-        assertEquals(uri, info.getOriginalURI());
-        assertEquals(100, info.getSize().getWidthPx()); //100 = default viewport size
-        assertEquals(100, info.getSize().getHeightPx());
-        assertEquals(userAgent.getSourceResolution(), info.getSize().getDpiHorizontal(), 0.1);
-        assertEquals(100000, info.getSize().getWidthMpt());
-        assertEquals(100000, info.getSize().getHeightMpt());
-    }
-
-    public void testWMF() throws Exception {
-        String uri = "test/resources/images/testChart.wmf";
-        
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
-        
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
-        assertNotNull("ImageInfo must not be null", info);
-        assertEquals(ImageWMF.MIME_WMF, info.getMimeType());
-        assertEquals(uri, info.getOriginalURI());
-        assertEquals(27940, info.getSize().getWidthPx());
-        assertEquals(21590, info.getSize().getHeightPx());
-        assertEquals(2540, info.getSize().getDpiHorizontal(), 0.1);
-        assertEquals(792000, info.getSize().getWidthMpt());
-        assertEquals(612000, info.getSize().getHeightMpt());
-    }
- 
     public void testEMF() throws Exception {
-        String uri = "test/resources/images/img.emf";
-        
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
+        String uri = "img.emf";
         
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
+
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
         assertEquals("image/emf", info.getMimeType());
         assertEquals(uri, info.getOriginalURI());
@@ -211,12 +144,12 @@
     }
  
     public void testJPEG1() throws Exception {
-        String uri = "test/resources/images/bgimg300dpi.jpg";
+        String uri = "bgimg300dpi.jpg";
         
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
-        
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
+
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
         assertEquals(MimeConstants.MIME_JPEG, info.getMimeType());
         assertEquals(uri, info.getOriginalURI());
@@ -228,12 +161,12 @@
     }
  
     public void testJPEG2() throws Exception {
-        String uri = "test/resources/images/cmyk.jpg";
+        String uri = "cmyk.jpg";
         
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
-        
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
+
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
         assertEquals(MimeConstants.MIME_JPEG, info.getMimeType());
         assertEquals(uri, info.getOriginalURI());
@@ -245,12 +178,12 @@
     }
  
     public void testBMP() throws Exception {
-        String uri = "test/resources/images/bgimg300dpi.bmp";
-        
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
+        String uri = "bgimg300dpi.bmp";
         
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
+
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
         assertEquals("image/bmp", info.getMimeType());
         assertEquals(uri, info.getOriginalURI());
@@ -262,52 +195,52 @@
     }
  
     public void testBMPNoResolution() throws Exception {
-        String uri = "test/resources/images/no-resolution.bmp";
-        
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
+        String uri = "no-resolution.bmp";
         
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
+
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
         assertEquals("image/bmp", info.getMimeType());
         assertEquals(uri, info.getOriginalURI());
         assertEquals(50, info.getSize().getWidthPx());
         assertEquals(50, info.getSize().getHeightPx());
-        assertEquals(userAgent.getSourceResolution(), info.getSize().getDpiHorizontal(), 0.1);
+        assertEquals(imageContext.getSourceResolution(), info.getSize().getDpiHorizontal(), 0.1);
         assertEquals(50000, info.getSize().getWidthMpt());
         assertEquals(50000, info.getSize().getHeightMpt());
     }
  
     public void testEPSAscii() throws Exception {
-        String uri = "test/resources/images/barcode.eps";
-        
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
+        String uri = "barcode.eps";
         
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
+
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
         assertEquals(MimeConstants.MIME_EPS, info.getMimeType());
         assertEquals(uri, info.getOriginalURI());
         assertEquals(136, info.getSize().getWidthPx());
         assertEquals(43, info.getSize().getHeightPx());
-        assertEquals(userAgent.getSourceResolution(), info.getSize().getDpiHorizontal(), 0.1);
+        assertEquals(imageContext.getSourceResolution(), info.getSize().getDpiHorizontal(), 0.1);
         assertEquals(135655, info.getSize().getWidthMpt());
         assertEquals(42525, info.getSize().getHeightMpt());
     }
  
     public void testEPSBinary() throws Exception {
-        String uri = "test/resources/images/img-with-tiff-preview.eps";
+        String uri = "img-with-tiff-preview.eps";
         
-        FOUserAgent userAgent = fopFactory.newFOUserAgent();
-        
-        ImageManager manager = fopFactory.getImageManager();
-        ImageInfo info = manager.preloadImage(uri, userAgent.getImageSessionContext());
+        ImageSessionContext sessionContext = imageContext.newSessionContext();
+        ImageManager manager = imageContext.getImageManager();
+
+        ImageInfo info = manager.preloadImage(uri, sessionContext);
         assertNotNull("ImageInfo must not be null", info);
         assertEquals(MimeConstants.MIME_EPS, info.getMimeType());
         assertEquals(uri, info.getOriginalURI());
         assertEquals(17, info.getSize().getWidthPx());
         assertEquals(17, info.getSize().getHeightPx());
-        assertEquals(userAgent.getSourceResolution(), info.getSize().getDpiHorizontal(), 0.1);
+        assertEquals(imageContext.getSourceResolution(), info.getSize().getDpiHorizontal(), 0.1);
         assertEquals(17000, info.getSize().getWidthMpt());
         assertEquals(17000, info.getSize().getHeightMpt());
     }

Modified: xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/ImageUtilTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/ImageUtilTestCase.java?rev=605222&r1=605206&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/ImageUtilTestCase.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/ImageUtilTestCase.java Tue Dec 18 07:03:41 2007
@@ -17,11 +17,11 @@
 
 /* $Id$ */
 
-package org.apache.fop.image2;
+package org.apache.xmlgraphics.image.loader;
 
 import junit.framework.TestCase;
 
-import org.apache.fop.image2.util.ImageUtil;
+import org.apache.xmlgraphics.image.loader.util.ImageUtil;
 
 /**
  * Tests for the ImageUtil class.

Added: xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/MockImageContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/MockImageContext.java?rev=605222&view=auto
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/MockImageContext.java (added)
+++ xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/MockImageContext.java Tue Dec 18 07:03:41 2007
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.xmlgraphics.image.loader;
+
+
+/**
+ * Mock implementation for testing.
+ */
+public class MockImageContext implements ImageContext {
+
+    private static MockImageContext instance;
+    
+    private ImageManager imageManager = new ImageManager(this);
+    
+    public static MockImageContext getInstance() {
+        if (instance == null) {
+            instance = new MockImageContext();
+        }
+        return instance;
+    }
+    
+    /** {@inheritDoc} */
+    public float getSourceResolution() {
+        return 72;
+    }
+
+    public ImageManager getImageManager() {
+        return this.imageManager;
+    }
+    
+    public ImageSessionContext newSessionContext() {
+        return new MockImageSessionContext();
+    }
+}

Propchange: xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/MockImageContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/MockImageContext.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/MockImageSessionContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/MockImageSessionContext.java?rev=605222&view=auto
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/MockImageSessionContext.java (added)
+++ xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/MockImageSessionContext.java Tue Dec 18 07:03:41 2007
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+ 
+package org.apache.xmlgraphics.image.loader;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+
+import org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext;
+
+/**
+ * Mock implementation for testing.
+ */
+public class MockImageSessionContext extends AbstractImageSessionContext {
+
+    /** {@inheritDoc} */
+    public ImageContext getParentContext() {
+        return MockImageContext.getInstance();
+    }
+
+    /** {@inheritDoc} */
+    protected Source resolveURI(String uri) {
+        try {
+            URL url = new URL(uri);
+            return new StreamSource(url.openStream(), url.toExternalForm());
+        } catch (MalformedURLException e) {
+            File baseDir = new File("./test/images/");
+            if (!baseDir.isDirectory()) {
+                throw new IllegalStateException("Base directory for test was not found.");
+            }
+            File f = new File(baseDir, uri);
+            if (f.isFile()) {
+                return new StreamSource(f);
+            } else {
+                return null;
+            }
+        } catch (IOException ioe) {
+            return null;
+        }
+    }
+
+    /** {@inheritDoc} */
+    public float getTargetResolution() {
+        return 300;
+    }
+
+}

Propchange: xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/MockImageSessionContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/MockImageSessionContext.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/cache/ImageCacheLoggingStatistics.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/cache/ImageCacheLoggingStatistics.java?rev=605222&r1=605206&r2=605222&view=diff
==============================================================================
--- xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/cache/ImageCacheLoggingStatistics.java (original)
+++ xmlgraphics/commons/branches/TempNewImagePackage/test/java/org/apache/xmlgraphics/image/loader/cache/ImageCacheLoggingStatistics.java Tue Dec 18 07:03:41 2007
@@ -17,7 +17,7 @@
 
 /* $Id$ */
 
-package org.apache.fop.image2.cache;
+package org.apache.xmlgraphics.image.loader.cache;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;



---------------------------------------------------------------------
Apache XML Graphics Project URL: http://xmlgraphics.apache.org/
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Mime
View raw message