xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dewe...@apache.org
Subject cvs commit: xml-batik/sources/org/apache/batik/ext/awt/image/spi JDKRegistryEntry.java
Date Fri, 01 Oct 2004 10:51:58 GMT
deweese     2004/10/01 03:51:58

  Modified:    sources/org/apache/batik/ext/awt/image/codec
                        PNGImageEncoder.java
               sources/org/apache/batik/ext/awt/image/spi
                        JDKRegistryEntry.java
  Log:
  1) Fixed a bug in the PNG Encoder for some 1,2 or 4 bit/pixel images.
  2) Made the JDK loading tracker static (so others could use it easier).
  
  Revision  Changes    Path
  1.10      +4 -3      xml-batik/sources/org/apache/batik/ext/awt/image/codec/PNGImageEncoder.java
  
  Index: PNGImageEncoder.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/codec/PNGImageEncoder.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- PNGImageEncoder.java	18 Aug 2004 07:13:52 -0000	1.9
  +++ PNGImageEncoder.java	1 Oct 2004 10:51:58 -0000	1.10
  @@ -371,15 +371,16 @@
                       int val = clamp(samples[s] >> bitShift, maxValue);
                       tmp = (tmp << bitDepth) | val;
   
  -                    if ((pos++ & mask) == mask) {
  +                    if (pos++  == mask) {
                           currRow[count++] = (byte)tmp;
                           tmp = 0;
  +                        pos = 0;
                       }
                   }
   
                   // Left shift the last byte
  -                if ((pos & mask) != 0) {
  -                    tmp <<= ((8/bitDepth) - pos)*bitDepth;
  +                if (pos != 0) {
  +                    tmp <<= (samplesPerByte - pos)*bitDepth;
                       currRow[count++] = (byte)tmp;
                   }
                   break;
  
  
  
  1.12      +1 -1      xml-batik/sources/org/apache/batik/ext/awt/image/spi/JDKRegistryEntry.java
  
  Index: JDKRegistryEntry.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/spi/JDKRegistryEntry.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JDKRegistryEntry.java	18 Aug 2004 07:14:15 -0000	1.11
  +++ JDKRegistryEntry.java	1 Oct 2004 10:51:58 -0000	1.12
  @@ -163,7 +163,7 @@
       }
   
   
  -    public class MyImgObs implements ImageObserver {
  +    public static class MyImgObs implements ImageObserver {
           boolean widthDone = false;
           boolean heightDone = false;
           boolean imageDone = false;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org


Mime
View raw message