incubator-sanselan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmc...@apache.org
Subject svn commit: r725887 - /incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GifImageParser.java
Date Fri, 12 Dec 2008 02:12:28 GMT
Author: cmchen
Date: Thu Dec 11 18:12:28 2008
New Revision: 725887

URL: http://svn.apache.org/viewvc?rev=725887&view=rev
Log:
slight tweak to the gif lzw implementation around minimum code sizes.

Modified:
    incubator/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GifImageParser.java

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=725887&r1=725886&r2=725887&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
Thu Dec 11 18:12:28 2008
@@ -239,7 +239,7 @@
 		while (true)
 		{
 			int code = is.read();
-//			 this.debugNumber("code: ", code);
+			// this.debugNumber("code: ", code);
 
 			switch (code)
 			{
@@ -614,7 +614,7 @@
 
 		boolean isTransparent = false;
 		if (gce != null && gce.transparency)
-				isTransparent = true;
+			isTransparent = true;
 
 		boolean usesPalette = true;
 		int colorType = ImageInfo.COLOR_TYPE_RGB;
@@ -1021,7 +1021,9 @@
 				int image_data_total = 0;
 
 				int LZWMinimumCodeSize = colorTableScaleLessOne + 1;
-				LZWMinimumCodeSize = Math.max(8, LZWMinimumCodeSize);
+//				LZWMinimumCodeSize = Math.max(8, LZWMinimumCodeSize);
+				if (LZWMinimumCodeSize < 2)
+					LZWMinimumCodeSize = 2;
 
 				// TODO:
 				// make



Mime
View raw message