Revision: 20096
          http://sourceforge.net/p/jmol/code/20096
Author:   hansonr
Date:     2014-11-10 02:28:42 +0000 (Mon, 10 Nov 2014)
Log Message:
-----------
Jmol.___JmolVersion="14.3.8_2014.11.09"

new feature: CAPTURE "filename0000.png"  
  -- captures set of PNG files
  -- 0000 is not required
  
new feature: CAPTURE "filename0000.gif"  
  -- captures set of GIF files
  -- 0000 IS required in order to distinguish this from animated GIF
  
bug fix: GIF writer not properly handling large numbers of colors
  -- use of CIE L*a*b for color quantification
  -- nearly identical to GIMP
  -- uses MEAN_cut (not MEDIAN_cut) 
  -- uses Floyd-Steinberg dithering
  -- will not discolor background (as GIMP will do)

bug fix: GIF and PPM writing broken in JavaScript
  -- initial putString improperly forces string buffer mode in OC (Output 
Channel)
  
bug fix: WRITE command should remove "t" or "j" in WRITE xxx.PNGJ, WRITE 
xxx.PNGT, WRITE xxx.GIFT
  -- specifically when no PNGJ, GIFT, or PNGT designation is made.
  
bug fix: PDB reader limited to 20 connections per atom
 
code: code clean-up in GData, Graphics3D, and Export3D
code: PDB reader CONECT efficiency

Modified Paths:
--------------
    trunk/Jmol/src/javajs/img/GifEncoder.java
    trunk/Jmol/src/javajs/img/ImageEncoder.java
    trunk/Jmol/src/javajs/util/OC.java
    trunk/Jmol/src/org/jmol/viewer/Jmol.properties

Modified: trunk/Jmol/src/javajs/img/GifEncoder.java
===================================================================
--- trunk/Jmol/src/javajs/img/GifEncoder.java   2014-11-09 22:14:35 UTC (rev 
20095)
+++ trunk/Jmol/src/javajs/img/GifEncoder.java   2014-11-10 02:28:42 UTC (rev 
20096)
@@ -78,7 +78,7 @@
  * GifEncoder extensively adapted for Jmol by Bob Hanson
  * 
  * Color quantization roughly follows the GIMP method
- * "dither Floyd-Steinberg standard" but with some twists.
+ * "dither Floyd-Steinberg (normal)" but with some twists.
  * (For example, we exclude the background color.)
  * 
  * Note that although GIMP code annotation refers to "median-cut", 

Modified: trunk/Jmol/src/javajs/img/ImageEncoder.java
===================================================================
--- trunk/Jmol/src/javajs/img/ImageEncoder.java 2014-11-09 22:14:35 UTC (rev 
20095)
+++ trunk/Jmol/src/javajs/img/ImageEncoder.java 2014-11-10 02:28:42 UTC (rev 
20096)
@@ -108,8 +108,9 @@
 
   protected int[] pixels;
 
-  protected void putString(String str) {
-    out.append(str);
+  protected void putString(String s) {
+    byte[] b = s.getBytes();
+    out.write(b, 0, b.length);
   }
 
   protected void putByte(int b) {

Modified: trunk/Jmol/src/javajs/util/OC.java
===================================================================
--- trunk/Jmol/src/javajs/util/OC.java  2014-11-09 22:14:35 UTC (rev 20095)
+++ trunk/Jmol/src/javajs/util/OC.java  2014-11-10 02:28:42 UTC (rev 20096)
@@ -138,6 +138,17 @@
 
   public void reset() {
     sb = null;
+    initOS();
+  }
+
+
+  private void initOS() {
+    if (sb != null) {
+      String s = sb.toString();
+      reset();
+      append(s);
+      return;
+    }
     try {
       /**
        * @j2sNative
@@ -165,25 +176,16 @@
     byteCount = 0;
   }
 
-
   /**
    * @j2sOverride
    */
   @Override
   public void write(byte[] buf, int i, int len) {
     if (os == null)
-      os = new ByteArrayOutputStream();
-    /**
-     * @j2sNative
-     * 
-     *            this.os.write(buf, i, len);
-     * 
-     */
-    {
-      try {
-        os.write(buf, i, len);
-      } catch (IOException e) {
-      }
+      initOS();
+    try {
+      os.write(buf, i, len);
+    } catch (IOException e) {
     }
     byteCount += len;
   }
@@ -193,7 +195,7 @@
    */
   public void writeByteAsInt(int b) {
     if (os == null)
-      os = new ByteArrayOutputStream();
+      initOS();
     /**
      * @j2sNative
      * 
@@ -221,7 +223,7 @@
   public void write(int b) {
     // required by standard ZipOutputStream -- do not use, as it will break 
JavaScript methods
     if (os == null)
-      os = new ByteArrayOutputStream();
+      initOS();
     try {
       os.write(b);
     } catch (IOException e) {

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2014-11-09 22:14:35 UTC 
(rev 20095)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2014-11-10 02:28:42 UTC 
(rev 20096)
@@ -26,8 +26,15 @@
   -- 0000 IS required in order to distinguish this from animated GIF
   
 bug fix: GIF writer not properly handling large numbers of colors
-  -- use of CIE L*a*b gives GIMP-like color quantification
+  -- use of CIE L*a*b for color quantification
+  -- nearly identical to GIMP
+  -- uses MEAN_cut (not MEDIAN_cut) 
+  -- uses Floyd-Steinberg dithering
+  -- will not discolor background (as GIMP will do)
 
+bug fix: GIF and PPM writing broken in JavaScript
+  -- initial putString improperly forces string buffer mode in OC (Output 
Channel)
+  
 bug fix: WRITE command should remove "t" or "j" in WRITE xxx.PNGJ, WRITE 
xxx.PNGT, WRITE xxx.GIFT
   -- specifically when no PNGJ, GIFT, or PNGT designation is made.
   

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to