incubator-sanselan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmc...@apache.org
Subject svn commit: r790017 - in /incubator/sanselan/trunk: ./ src/main/java/org/apache/sanselan/ src/main/java/org/apache/sanselan/formats/bmp/ src/main/java/org/apache/sanselan/formats/gif/ src/main/java/org/apache/sanselan/formats/ico/ src/main/java/org/apa...
Date Wed, 01 Jul 2009 01:43:19 GMT
Author: cmchen
Date: Wed Jul  1 01:43:18 2009
New Revision: 790017

URL: http://svn.apache.org/viewvc?rev=790017&view=rev
Log:
* Fixed a bug in which gifs have incorrect size information in the the Logical Screen Descriptor.
   This appears to be a bug in how Microsoft Office writes gifs.
   The Image Descriptor has the correct value.
 * Misc. clean up of code, esp. of GifImageParser.

Added:
    incubator/sanselan/trunk/src/test/data/images/bmp/2/
    incubator/sanselan/trunk/src/test/data/images/bmp/2/@broken/
    incubator/sanselan/trunk/src/test/data/images/bmp/2/@broken/SanselanTest.bmp   (with props)
    incubator/sanselan/trunk/src/test/data/images/bmp/2/info.txt   (with props)
    incubator/sanselan/trunk/src/test/data/images/gif/2/
    incubator/sanselan/trunk/src/test/data/images/gif/2/info.txt   (with props)
    incubator/sanselan/trunk/src/test/data/images/gif/2/test.gif   (with props)
Modified:
    incubator/sanselan/trunk/RELEASE_NOTES
    incubator/sanselan/trunk/src/main/java/org/apache/sanselan/Sanselan.java
    incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/bmp/BmpImageParser.java
    incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GIFHeaderInfo.java
    incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GifImageParser.java
    incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/ico/IcoImageParser.java
    incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/JpegImageParser.java
    incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/PngImageParser.java
    incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/pnm/PNMImageParser.java
    incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/PsdImageParser.java
    incubator/sanselan/trunk/src/test/java/org/apache/sanselan/common/byteSources/ByteSourceImageTest.java
    incubator/sanselan/trunk/src/test/java/org/apache/sanselan/common/byteSources/ByteSourceTest.java
    incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/bmp/BmpBaseTest.java
    incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/gif/GifBaseTest.java
    incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/gif/GifReadTest.java
    incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/jpeg/iptc/IptcUpdateTest.java
    incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/jpeg/xmp/JpegXmpRewriteTest.java
    incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/png/PngBaseTest.java
    incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/png/PngReadTest.java
    incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/tiff/TiffBaseTest.java
    incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/tiff/TiffLZWTest.java
    incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/tiff/TiffReadTest.java
    incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/xmp/XmpDumpTest.java
    incubator/sanselan/trunk/src/test/java/org/apache/sanselan/roundtrip/RoundtripTest.java

Modified: incubator/sanselan/trunk/RELEASE_NOTES
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/RELEASE_NOTES?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/RELEASE_NOTES (original)
+++ incubator/sanselan/trunk/RELEASE_NOTES Wed Jul  1 01:43:18 2009
@@ -12,6 +12,13 @@
 Version History:
 ----------------
 
+Next Release
+------------
+ * Fixed a bug in which gifs have incorrect size information in the the Logical Screen Descriptor.
+   This appears to be a bug in how Microsoft Office writes gifs.
+   The Image Descriptor has the correct value.
+
+
 Release 0.97
 ------------
 	

Modified: incubator/sanselan/trunk/src/main/java/org/apache/sanselan/Sanselan.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/main/java/org/apache/sanselan/Sanselan.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/main/java/org/apache/sanselan/Sanselan.java (original)
+++ incubator/sanselan/trunk/src/main/java/org/apache/sanselan/Sanselan.java Wed Jul  1 01:43:18
2009
@@ -726,7 +726,7 @@
 	 *            InputStream from which to read image data.
 	 * @param filename
 	 *            Filename associated with image data (optional).
-	 * @return Xmp Xml as String, if present.  Otherwise, returns null..
+	 * @return Xmp Xml as String, if present.  Otherwise, returns null.
 	 */
 	public static String getXmpXml(InputStream is, String filename)
 			throws ImageReadException, IOException {
@@ -743,7 +743,7 @@
 	 *            Filename associated with image data (optional).
 	 * @param params
 	 *            Map of optional parameters, defined in SanselanConstants.
-	 * @return Xmp Xml as String, if present.  Otherwise, returns null..
+	 * @return Xmp Xml as String, if present.  Otherwise, returns null.
 	 */
 	public static String getXmpXml(InputStream is, String filename,
 			Map params) throws ImageReadException, IOException {
@@ -756,7 +756,7 @@
 	 * 
 	 * @param bytes
 	 *            Byte array containing an image file.
-	 * @return Xmp Xml as String, if present.  Otherwise, returns null..
+	 * @return Xmp Xml as String, if present.  Otherwise, returns null.
 	 */
 	public static String getXmpXml(byte bytes[])
 			throws ImageReadException, IOException {
@@ -771,7 +771,7 @@
 	 *            Byte array containing an image file.
 	 * @param params
 	 *            Map of optional parameters, defined in SanselanConstants.
-	 * @return Xmp Xml as String, if present.  Otherwise, returns null..
+	 * @return Xmp Xml as String, if present.  Otherwise, returns null.
 	 */
 	public static String getXmpXml(byte bytes[], Map params)
 			throws ImageReadException, IOException {
@@ -784,7 +784,7 @@
 	 * 
 	 * @param file
 	 *            File containing image data.
-	 * @return Xmp Xml as String, if present.  Otherwise, returns null..
+	 * @return Xmp Xml as String, if present.  Otherwise, returns null.
 	 */
 	public static String getXmpXml(File file) throws ImageReadException,
 			IOException {
@@ -799,7 +799,7 @@
 	 *            File containing image data.
 	 * @param params
 	 *            Map of optional parameters, defined in SanselanConstants.
-	 * @return Xmp Xml as String, if present.  Otherwise, returns null..
+	 * @return Xmp Xml as String, if present.  Otherwise, returns null.
 	 */
 	public static String getXmpXml(File file, Map params)
 			throws ImageReadException, IOException {
@@ -814,7 +814,7 @@
 	 *            File containing image data.
 	 * @param params
 	 *            Map of optional parameters, defined in SanselanConstants.
-	 * @return Xmp Xml as String, if present.  Otherwise, returns null..
+	 * @return Xmp Xml as String, if present.  Otherwise, returns null.
 	 */
 	public static String getXmpXml(ByteSource byteSource, Map params)
 			throws ImageReadException, IOException {

Modified: incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/bmp/BmpImageParser.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/bmp/BmpImageParser.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/bmp/BmpImageParser.java
(original)
+++ incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/bmp/BmpImageParser.java
Wed Jul  1 01:43:18 2009
@@ -702,7 +702,7 @@
 	 *            File containing image data.
 	 * @param params
 	 *            Map of optional parameters, defined in SanselanConstants.
-	 * @return Xmp Xml as String, if present. Otherwise, returns null..
+	 * @return Xmp Xml as String, if present. Otherwise, returns null.
 	 */
 	public String getXmpXml(ByteSource byteSource, Map params)
 			throws ImageReadException, IOException

Modified: incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GIFHeaderInfo.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GIFHeaderInfo.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GIFHeaderInfo.java
(original)
+++ incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GIFHeaderInfo.java
Wed Jul  1 01:43:18 2009
@@ -57,7 +57,5 @@
 		this.colorResolution = ColorResolution;
 		this.sortFlag = SortFlag;
 		this.sizeOfGlobalColorTable = SizeofGlobalColorTable;
-
 	}
-
 }
\ No newline at end of file

Modified: incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GifImageParser.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GifImageParser.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GifImageParser.java
(original)
+++ incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GifImageParser.java
Wed Jul  1 01:43:18 2009
@@ -239,7 +239,6 @@
 		while (true)
 		{
 			int code = is.read();
-			// this.debugNumber("code: ", code);
 
 			switch (code)
 			{
@@ -258,7 +257,6 @@
 			case EXTENSION_CODE: // extension
 			{
 				int extensionCode = is.read();
-				// this.debugNumber("extension_code: ", extension_code);
 				int completeCode = ((0xff & code) << 8)
 						| (0xff & extensionCode);
 
@@ -297,8 +295,6 @@
 					{
 						GenericGIFBlock block = readGenericGIFBlock(is,
 								completeCode, label);
-						byte bytes[] = block.appendSubBlocks();
-
 						result.add(block);
 					}
 					break;
@@ -504,7 +500,6 @@
 		{
 			try
 			{
-				// bis.close();
 				is.close();
 			} catch (Exception e)
 			{
@@ -523,13 +518,23 @@
 	public Dimension getImageSize(ByteSource byteSource, Map params)
 			throws ImageReadException, IOException
 	{
-		GIFHeaderInfo bhi = readHeader(byteSource);
+		ImageContents blocks = readFile(byteSource, false);
+
+		if (blocks == null)
+			throw new ImageReadException("GIF: Couldn't read blocks");
 
+		GIFHeaderInfo bhi = blocks.gifHeaderInfo;
 		if (bhi == null)
 			throw new ImageReadException("GIF: Couldn't read Header");
 
-		return new Dimension(bhi.logicalScreenWidth, bhi.logicalScreenHeight);
+		ImageDescriptor id = (ImageDescriptor) findBlock(blocks.blocks,
+				IMAGE_SEPARATOR);
+		if (id == null)
+			throw new ImageReadException("GIF: Couldn't read ImageDescriptor");
 
+		// Prefer the size information in the ImageDescriptor; it is more reliable
+		// than the size information in the header.
+		return new Dimension(id.imageWidth, id.imageHeight);
 	}
 
 	public byte[] embedICCProfile(byte image[], byte profile[])
@@ -587,8 +592,10 @@
 		GraphicControlExtension gce = (GraphicControlExtension) findBlock(
 				blocks.blocks, GRAPHIC_CONTROL_EXTENSION);
 
-		int Height = bhi.logicalScreenHeight;
-		int Width = bhi.logicalScreenWidth;
+		// Prefer the size information in the ImageDescriptor; it is more reliable
+		// than the size information in the header.
+		int height = id.imageWidth;
+		int width = id.imageHeight;
 
 		ArrayList Comments;
 
@@ -604,9 +611,9 @@
 		boolean isProgressive = id.interlaceFlag;
 
 		int PhysicalWidthDpi = 72;
-		float PhysicalWidthInch = (float) ((double) Width / (double) PhysicalWidthDpi);
+		float PhysicalWidthInch = (float) ((double) width / (double) PhysicalWidthDpi);
 		int PhysicalHeightDpi = 72;
-		float PhysicalHeightInch = (float) ((double) Height / (double) PhysicalHeightDpi);
+		float PhysicalHeightInch = (float) ((double) height / (double) PhysicalHeightDpi);
 
 		String FormatDetails = "Gif " + ((char) blocks.gifHeaderInfo.version1)
 				+ ((char) blocks.gifHeaderInfo.version2)
@@ -621,9 +628,9 @@
 		String compressionAlgorithm = ImageInfo.COMPRESSION_ALGORITHM_LZW;
 
 		ImageInfo result = new ImageInfo(FormatDetails, BitsPerPixel, Comments,
-				Format, FormatName, Height, MimeType, NumberOfImages,
+				Format, FormatName, height, MimeType, NumberOfImages,
 				PhysicalHeightDpi, PhysicalHeightInch, PhysicalWidthDpi,
-				PhysicalWidthInch, Width, isProgressive, isTransparent,
+				PhysicalWidthInch, width, isProgressive, isTransparent,
 				usesPalette, colorType, compressionAlgorithm);
 
 		return result;
@@ -718,8 +725,10 @@
 		GraphicControlExtension gce = (GraphicControlExtension) findBlock(
 				imageContents.blocks, GRAPHIC_CONTROL_EXTENSION);
 
-		int width = ghi.logicalScreenWidth;
-		int height = ghi.logicalScreenHeight;
+		// Prefer the size information in the ImageDescriptor; it is more reliable
+		// than the size information in the header.
+		int width = id.imageWidth;
+		int height = id.imageHeight;
 
 		boolean hasAlpha = false;
 		if (gce != null && gce.transparency)
@@ -729,11 +738,11 @@
 				.getColorBufferedImage(width, height, hasAlpha);
 
 		{
-			int colortable[];
+			int colorTable[];
 			if (id.localColorTable != null)
-				colortable = getColorTable(id.localColorTable);
+				colorTable = getColorTable(id.localColorTable);
 			else if (imageContents.globalColorTable != null)
-				colortable = getColorTable(imageContents.globalColorTable);
+				colorTable = getColorTable(imageContents.globalColorTable);
 			else
 				throw new ImageReadException("Gif: No Color Table");
 
@@ -741,43 +750,37 @@
 			if (hasAlpha)
 				transparentIndex = gce.transparentColorIndex;
 
-			// Debug.debug("charles TransparentIndex", TransparentIndex);
-
 			int counter = 0;
-			// ByteArrayInputStream bais = new
-			// ByteArrayInputStream(id.ImageData);
-			// for (int y = 0; y < height; y++)
-
-			int rows_in_pass_1 = (height + 7) / 8;
-			int rows_in_pass_2 = (height + 3) / 8;
-			int rows_in_pass_3 = (height + 1) / 4;
-			int rows_in_pass_4 = (height) / 2;
+
+			int rowsInPass1 = (height + 7) / 8;
+			int rowsInPass2 = (height + 3) / 8;
+			int rowsInPass3 = (height + 1) / 4;
+			int rowsInPass4 = (height) / 2;
 
 			DataBuffer db = result.getRaster().getDataBuffer();
 
 			for (int row = 0; row < height; row++)
 			{
-
 				int y;
 				if (id.interlaceFlag)
 				{
 					int the_row = row;
-					if (the_row < rows_in_pass_1)
+					if (the_row < rowsInPass1)
 						y = the_row * 8;
 					else
 					{
-						the_row -= rows_in_pass_1;
-						if (the_row < (rows_in_pass_2))
+						the_row -= rowsInPass1;
+						if (the_row < (rowsInPass2))
 							y = 4 + (the_row * 8);
 						else
 						{
-							the_row -= rows_in_pass_2;
-							if (the_row < (rows_in_pass_3))
+							the_row -= rowsInPass2;
+							if (the_row < (rowsInPass3))
 								y = 2 + (the_row * 4);
 							else
 							{
-								the_row -= rows_in_pass_3;
-								if (the_row < (rows_in_pass_4))
+								the_row -= rowsInPass3;
+								if (the_row < (rowsInPass4))
 									y = 1 + (the_row * 2);
 								else
 									throw new ImageReadException(
@@ -785,15 +788,13 @@
 							}
 						}
 					}
-					// System.out.println("row(" + row + "): " + y);
 				} else
 					y = row;
 
 				for (int x = 0; x < width; x++)
 				{
-
 					int index = 0xff & id.imageData[counter++];
-					int rgb = colortable[index];
+					int rgb = colorTable[index];
 
 					if (transparentIndex == index)
 						rgb = 0x00;
@@ -1097,7 +1098,7 @@
 	 *            File containing image data.
 	 * @param params
 	 *            Map of optional parameters, defined in SanselanConstants.
-	 * @return Xmp Xml as String, if present. Otherwise, returns null..
+	 * @return Xmp Xml as String, if present. Otherwise, returns null.
 	 */
 	public String getXmpXml(ByteSource byteSource, Map params)
 			throws ImageReadException, IOException
@@ -1111,10 +1112,8 @@
 			FormatCompliance formatCompliance = null;
 			GIFHeaderInfo ghi = readHeader(is, formatCompliance);
 
-			byte globalColorTable[] = null;
 			if (ghi.globalColorTableFlag)
-				globalColorTable = readColorTable(is,
-						ghi.sizeOfGlobalColorTable, formatCompliance);
+				readColorTable(is, ghi.sizeOfGlobalColorTable, formatCompliance);
 
 			ArrayList blocks = readBlocks(ghi, is, true, formatCompliance);
 
@@ -1131,14 +1130,11 @@
 				if (blockBytes.length < XMP_APPLICATION_ID_AND_AUTH_CODE.length)
 					continue;
 
-				// this.debugByteArray("blockBytes", blockBytes);
-
 				if (!compareByteArrays(blockBytes, 0,
 						XMP_APPLICATION_ID_AND_AUTH_CODE, 0,
 						XMP_APPLICATION_ID_AND_AUTH_CODE.length))
 					continue;
 
-				// this.debugByteArray("xmp block bytes", blockBytes);
 				byte GIF_MAGIC_TRAILER[] = new byte[256];
 				for (int magic = 0; magic <= 0xff; magic++)
 					GIF_MAGIC_TRAILER[magic] = (byte) (0xff - magic);

Modified: incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/ico/IcoImageParser.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/ico/IcoImageParser.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/ico/IcoImageParser.java
(original)
+++ incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/ico/IcoImageParser.java
Wed Jul  1 01:43:18 2009
@@ -547,7 +547,7 @@
 	 *            File containing image data.
 	 * @param params
 	 *            Map of optional parameters, defined in SanselanConstants.
-	 * @return Xmp Xml as String, if present.  Otherwise, returns null..
+	 * @return Xmp Xml as String, if present.  Otherwise, returns null.
 	 */
 	public String getXmpXml(ByteSource byteSource, Map params)
 			throws ImageReadException, IOException {

Modified: incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/JpegImageParser.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/JpegImageParser.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/JpegImageParser.java
(original)
+++ incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/JpegImageParser.java
Wed Jul  1 01:43:18 2009
@@ -538,7 +538,7 @@
 	 *            File containing image data.
 	 * @param params
 	 *            Map of optional parameters, defined in SanselanConstants.
-	 * @return Xmp Xml as String, if present. Otherwise, returns null..
+	 * @return Xmp Xml as String, if present. Otherwise, returns null.
 	 */
 	public String getXmpXml(ByteSource byteSource, Map params)
 			throws ImageReadException, IOException

Modified: incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/PngImageParser.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/PngImageParser.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/PngImageParser.java
(original)
+++ incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/PngImageParser.java
Wed Jul  1 01:43:18 2009
@@ -854,7 +854,7 @@
 	 *            File containing image data.
 	 * @param params
 	 *            Map of optional parameters, defined in SanselanConstants.
-	 * @return Xmp Xml as String, if present. Otherwise, returns null..
+	 * @return Xmp Xml as String, if present. Otherwise, returns null.
 	 */
 	public String getXmpXml(ByteSource byteSource, Map params)
 			throws ImageReadException, IOException

Modified: incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/pnm/PNMImageParser.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/pnm/PNMImageParser.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/pnm/PNMImageParser.java
(original)
+++ incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/pnm/PNMImageParser.java
Wed Jul  1 01:43:18 2009
@@ -349,7 +349,7 @@
 	 *            File containing image data.
 	 * @param params
 	 *            Map of optional parameters, defined in SanselanConstants.
-	 * @return Xmp Xml as String, if present. Otherwise, returns null..
+	 * @return Xmp Xml as String, if present. Otherwise, returns null.
 	 */
 	public String getXmpXml(ByteSource byteSource, Map params)
 			throws ImageReadException, IOException

Modified: incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/PsdImageParser.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/PsdImageParser.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/PsdImageParser.java
(original)
+++ incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/PsdImageParser.java
Wed Jul  1 01:43:18 2009
@@ -785,7 +785,7 @@
 	 *            File containing image data.
 	 * @param params
 	 *            Map of optional parameters, defined in SanselanConstants.
-	 * @return Xmp Xml as String, if present. Otherwise, returns null..
+	 * @return Xmp Xml as String, if present. Otherwise, returns null.
 	 */
 	public String getXmpXml(ByteSource byteSource, Map params)
 			throws ImageReadException, IOException

Added: incubator/sanselan/trunk/src/test/data/images/bmp/2/@broken/SanselanTest.bmp
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/data/images/bmp/2/%40broken/SanselanTest.bmp?rev=790017&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/sanselan/trunk/src/test/data/images/bmp/2/@broken/SanselanTest.bmp
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/sanselan/trunk/src/test/data/images/bmp/2/info.txt
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/data/images/bmp/2/info.txt?rev=790017&view=auto
==============================================================================
--- incubator/sanselan/trunk/src/test/data/images/bmp/2/info.txt (added)
+++ incubator/sanselan/trunk/src/test/data/images/bmp/2/info.txt Wed Jul  1 01:43:18 2009
@@ -0,0 +1 @@
+image contributed by Kevin Theisen.

Propchange: incubator/sanselan/trunk/src/test/data/images/bmp/2/info.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/sanselan/trunk/src/test/data/images/gif/2/info.txt
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/data/images/gif/2/info.txt?rev=790017&view=auto
==============================================================================
--- incubator/sanselan/trunk/src/test/data/images/gif/2/info.txt (added)
+++ incubator/sanselan/trunk/src/test/data/images/gif/2/info.txt Wed Jul  1 01:43:18 2009
@@ -0,0 +1,3 @@
+Contributed to the project by Holger Veltrup.Image is 300x320, but oddly the Logical Screen
Width in the Logical Screen Descriptor is 301, not 300.
+This appears to be a bug in how Microsoft Office writes gifs.
+The Image Descriptor has the correct value.

Propchange: incubator/sanselan/trunk/src/test/data/images/gif/2/info.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/sanselan/trunk/src/test/data/images/gif/2/test.gif
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/data/images/gif/2/test.gif?rev=790017&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/sanselan/trunk/src/test/data/images/gif/2/test.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: incubator/sanselan/trunk/src/test/java/org/apache/sanselan/common/byteSources/ByteSourceImageTest.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/java/org/apache/sanselan/common/byteSources/ByteSourceImageTest.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/test/java/org/apache/sanselan/common/byteSources/ByteSourceImageTest.java
(original)
+++ incubator/sanselan/trunk/src/test/java/org/apache/sanselan/common/byteSources/ByteSourceImageTest.java
Wed Jul  1 01:43:18 2009
@@ -40,18 +40,6 @@
 
 public class ByteSourceImageTest extends ByteSourceTest
 {
-	// public ByteSourceImageTest()
-	// {
-	// super(ByteSourceImageTest.class.getName());
-	// }
-
-	/**
-	 * @return the suite of tests being tested
-	 */
-	public static Test suite()
-	{
-		return new TestSuite(ByteSourceImageTest.class);
-	}
 
 	public void test() throws IOException, ImageReadException,
 			IllegalAccessException, IllegalArgumentException,

Modified: incubator/sanselan/trunk/src/test/java/org/apache/sanselan/common/byteSources/ByteSourceTest.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/java/org/apache/sanselan/common/byteSources/ByteSourceTest.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/test/java/org/apache/sanselan/common/byteSources/ByteSourceTest.java
(original)
+++ incubator/sanselan/trunk/src/test/java/org/apache/sanselan/common/byteSources/ByteSourceTest.java
Wed Jul  1 01:43:18 2009
@@ -28,11 +28,6 @@
 
 public abstract class ByteSourceTest extends SanselanTest
 {
-	// public ByteSourceTest(String name)
-	// {
-	// super(name);
-	// }
-
 	protected File createTempFile(byte src[]) throws IOException
 	{
 		File file = createTempFile("raw_", ".bin");

Modified: incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/bmp/BmpBaseTest.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/bmp/BmpBaseTest.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/bmp/BmpBaseTest.java
(original)
+++ incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/bmp/BmpBaseTest.java
Wed Jul  1 01:43:18 2009
@@ -17,19 +17,14 @@
 
 package org.apache.sanselan.formats.bmp;
 
-import java.awt.image.BufferedImage;
 import java.io.File;
 import java.io.IOException;
 import java.util.List;
 
 import org.apache.sanselan.ImageFormat;
-import org.apache.sanselan.ImageInfo;
 import org.apache.sanselan.ImageReadException;
-import org.apache.sanselan.ImageWriteException;
 import org.apache.sanselan.Sanselan;
 import org.apache.sanselan.SanselanTest;
-import org.apache.sanselan.common.IImageMetadata;
-import org.apache.sanselan.util.Debug;
 
 public abstract class BmpBaseTest extends SanselanTest
 {

Modified: incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/gif/GifBaseTest.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/gif/GifBaseTest.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/gif/GifBaseTest.java
(original)
+++ incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/gif/GifBaseTest.java
Wed Jul  1 01:43:18 2009
@@ -17,19 +17,14 @@
 
 package org.apache.sanselan.formats.gif;
 
-import java.awt.image.BufferedImage;
 import java.io.File;
 import java.io.IOException;
 import java.util.List;
 
 import org.apache.sanselan.ImageFormat;
-import org.apache.sanselan.ImageInfo;
 import org.apache.sanselan.ImageReadException;
-import org.apache.sanselan.ImageWriteException;
 import org.apache.sanselan.Sanselan;
 import org.apache.sanselan.SanselanTest;
-import org.apache.sanselan.common.IImageMetadata;
-import org.apache.sanselan.util.Debug;
 
 public abstract class GifBaseTest extends SanselanTest
 {
@@ -53,5 +48,4 @@
 		return getTestImages(IMAGE_FILTER);
 	}
 
-
 }

Modified: incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/gif/GifReadTest.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/gif/GifReadTest.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/gif/GifReadTest.java
(original)
+++ incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/gif/GifReadTest.java
Wed Jul  1 01:43:18 2009
@@ -22,12 +22,10 @@
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.sanselan.ImageFormat;
 import org.apache.sanselan.ImageInfo;
 import org.apache.sanselan.ImageReadException;
 import org.apache.sanselan.ImageWriteException;
 import org.apache.sanselan.Sanselan;
-import org.apache.sanselan.SanselanTest;
 import org.apache.sanselan.common.IImageMetadata;
 import org.apache.sanselan.util.Debug;
 

Modified: incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/jpeg/iptc/IptcUpdateTest.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/jpeg/iptc/IptcUpdateTest.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/jpeg/iptc/IptcUpdateTest.java
(original)
+++ incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/jpeg/iptc/IptcUpdateTest.java
Wed Jul  1 01:43:18 2009
@@ -33,7 +33,6 @@
 import org.apache.sanselan.common.byteSources.ByteSourceFile;
 import org.apache.sanselan.formats.jpeg.JpegImageParser;
 import org.apache.sanselan.formats.jpeg.JpegPhotoshopMetadata;
-import org.apache.sanselan.formats.jpeg.JpegUtils;
 import org.apache.sanselan.util.Debug;
 
 public class IptcUpdateTest extends IptcBaseTest

Modified: incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/jpeg/xmp/JpegXmpRewriteTest.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/jpeg/xmp/JpegXmpRewriteTest.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/jpeg/xmp/JpegXmpRewriteTest.java
(original)
+++ incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/jpeg/xmp/JpegXmpRewriteTest.java
Wed Jul  1 01:43:18 2009
@@ -31,7 +31,6 @@
 import org.apache.sanselan.common.byteSources.ByteSource;
 import org.apache.sanselan.common.byteSources.ByteSourceFile;
 import org.apache.sanselan.formats.jpeg.JpegImageParser;
-import org.apache.sanselan.formats.jpeg.JpegUtils;
 import org.apache.sanselan.util.Debug;
 
 public class JpegXmpRewriteTest extends JpegXmpBaseTest

Modified: incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/png/PngBaseTest.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/png/PngBaseTest.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/png/PngBaseTest.java
(original)
+++ incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/png/PngBaseTest.java
Wed Jul  1 01:43:18 2009
@@ -17,19 +17,14 @@
 
 package org.apache.sanselan.formats.png;
 
-import java.awt.image.BufferedImage;
 import java.io.File;
 import java.io.IOException;
 import java.util.List;
 
 import org.apache.sanselan.ImageFormat;
-import org.apache.sanselan.ImageInfo;
 import org.apache.sanselan.ImageReadException;
-import org.apache.sanselan.ImageWriteException;
 import org.apache.sanselan.Sanselan;
 import org.apache.sanselan.SanselanTest;
-import org.apache.sanselan.common.IImageMetadata;
-import org.apache.sanselan.util.Debug;
 
 public abstract class PngBaseTest extends SanselanTest
 {

Modified: incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/png/PngReadTest.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/png/PngReadTest.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/png/PngReadTest.java
(original)
+++ incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/png/PngReadTest.java
Wed Jul  1 01:43:18 2009
@@ -22,12 +22,10 @@
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.sanselan.ImageFormat;
 import org.apache.sanselan.ImageInfo;
 import org.apache.sanselan.ImageReadException;
 import org.apache.sanselan.ImageWriteException;
 import org.apache.sanselan.Sanselan;
-import org.apache.sanselan.SanselanTest;
 import org.apache.sanselan.common.IImageMetadata;
 import org.apache.sanselan.util.Debug;
 

Modified: incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/tiff/TiffBaseTest.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/tiff/TiffBaseTest.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/tiff/TiffBaseTest.java
(original)
+++ incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/tiff/TiffBaseTest.java
Wed Jul  1 01:43:18 2009
@@ -17,19 +17,14 @@
 
 package org.apache.sanselan.formats.tiff;
 
-import java.awt.image.BufferedImage;
 import java.io.File;
 import java.io.IOException;
 import java.util.List;
 
 import org.apache.sanselan.ImageFormat;
-import org.apache.sanselan.ImageInfo;
 import org.apache.sanselan.ImageReadException;
-import org.apache.sanselan.ImageWriteException;
 import org.apache.sanselan.Sanselan;
 import org.apache.sanselan.SanselanTest;
-import org.apache.sanselan.common.IImageMetadata;
-import org.apache.sanselan.util.Debug;
 
 public abstract class TiffBaseTest extends SanselanTest
 {

Modified: incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/tiff/TiffLZWTest.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/tiff/TiffLZWTest.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/tiff/TiffLZWTest.java
(original)
+++ incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/tiff/TiffLZWTest.java
Wed Jul  1 01:43:18 2009
@@ -18,19 +18,12 @@
 package org.apache.sanselan.formats.tiff;
 
 import java.io.ByteArrayInputStream;
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
-import org.apache.sanselan.ImageReadException;
-import org.apache.sanselan.ImageWriteException;
 import org.apache.sanselan.common.BinaryConstants;
-import org.apache.sanselan.common.byteSources.ByteSource;
-import org.apache.sanselan.common.byteSources.ByteSourceFile;
 import org.apache.sanselan.common.mylzw.MyLZWCompressor;
 import org.apache.sanselan.common.mylzw.MyLZWDecompressor;
 import org.apache.sanselan.util.Debug;

Modified: incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/tiff/TiffReadTest.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/tiff/TiffReadTest.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/tiff/TiffReadTest.java
(original)
+++ incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/tiff/TiffReadTest.java
Wed Jul  1 01:43:18 2009
@@ -22,12 +22,10 @@
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.sanselan.ImageFormat;
 import org.apache.sanselan.ImageInfo;
 import org.apache.sanselan.ImageReadException;
 import org.apache.sanselan.ImageWriteException;
 import org.apache.sanselan.Sanselan;
-import org.apache.sanselan.SanselanTest;
 import org.apache.sanselan.common.IImageMetadata;
 import org.apache.sanselan.util.Debug;
 

Modified: incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/xmp/XmpDumpTest.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/xmp/XmpDumpTest.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/xmp/XmpDumpTest.java
(original)
+++ incubator/sanselan/trunk/src/test/java/org/apache/sanselan/formats/xmp/XmpDumpTest.java
Wed Jul  1 01:43:18 2009
@@ -19,17 +19,12 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import org.apache.sanselan.ImageReadException;
 import org.apache.sanselan.ImageWriteException;
 import org.apache.sanselan.Sanselan;
 import org.apache.sanselan.SanselanTest;
-import org.apache.sanselan.common.byteSources.ByteSource;
-import org.apache.sanselan.common.byteSources.ByteSourceFile;
-import org.apache.sanselan.formats.jpeg.JpegImageParser;
 import org.apache.sanselan.util.Debug;
 
 public class XmpDumpTest extends SanselanTest

Modified: incubator/sanselan/trunk/src/test/java/org/apache/sanselan/roundtrip/RoundtripTest.java
URL: http://svn.apache.org/viewvc/incubator/sanselan/trunk/src/test/java/org/apache/sanselan/roundtrip/RoundtripTest.java?rev=790017&r1=790016&r2=790017&view=diff
==============================================================================
--- incubator/sanselan/trunk/src/test/java/org/apache/sanselan/roundtrip/RoundtripTest.java
(original)
+++ incubator/sanselan/trunk/src/test/java/org/apache/sanselan/roundtrip/RoundtripTest.java
Wed Jul  1 01:43:18 2009
@@ -20,7 +20,6 @@
 import java.awt.image.BufferedImage;
 import java.io.File;
 import java.io.IOException;
-import java.io.PrintWriter;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -31,8 +30,6 @@
 import org.apache.sanselan.SanselanConstants;
 import org.apache.sanselan.SanselanTest;
 import org.apache.sanselan.common.RgbBufferedImageFactory;
-import org.apache.sanselan.common.byteSources.ByteSourceFile;
-import org.apache.sanselan.formats.png.PngImageParser;
 import org.apache.sanselan.util.Debug;
 import org.apache.sanselan.util.IOUtils;
 



Mime
View raw message