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/transcoder/image PNGTranscoder.java TIFFTranscoder.java
Date Mon, 11 Mar 2002 17:34:52 GMT
deweese     02/03/11 09:34:52

  Modified:    sources/org/apache/batik/transcoder/image PNGTranscoder.java
                        TIFFTranscoder.java
  Log:
  1) PNG files now include pHYs chunk which specifies resolution information.
  2) Fixed a 1/x bug in Tiff resolution information.
  
  Revision  Changes    Path
  1.13      +6 -1      xml-batik/sources/org/apache/batik/transcoder/image/PNGTranscoder.java
  
  Index: PNGTranscoder.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/transcoder/image/PNGTranscoder.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- PNGTranscoder.java	7 Mar 2002 22:07:44 -0000	1.12
  +++ PNGTranscoder.java	11 Mar 2002 17:34:52 -0000	1.13
  @@ -26,7 +26,7 @@
    * This class is an <tt>ImageTranscoder</tt> that produces a PNG image.
    *
    * @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
  - * @version $Id: PNGTranscoder.java,v 1.12 2002/03/07 22:07:44 deweese Exp $
  + * @version $Id: PNGTranscoder.java,v 1.13 2002/03/11 17:34:52 deweese Exp $
    */
   public class PNGTranscoder extends ImageTranscoder {
   
  @@ -73,6 +73,11 @@
           // We always want an sRGB chunk and Our encoding intent is
           // perceptual
           params.setSRGBIntent(PNGEncodeParam.INTENT_PERCEPTUAL);
  +
  +        float pixToMM = userAgent.getPixelToMM();
  +        // Pixs in 1 Meter
  +        int numPix      = (int)(1000/pixToMM+0.5);
  +        params.setPhysicalDimension(numPix, numPix, 1); // 1 means 'pix/meter'
   
           //
           // This is a trick so that viewers which do not support the alpha
  
  
  
  1.3       +2 -2      xml-batik/sources/org/apache/batik/transcoder/image/TIFFTranscoder.java
  
  Index: TIFFTranscoder.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/transcoder/image/TIFFTranscoder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TIFFTranscoder.java	7 Mar 2002 22:07:44 -0000	1.2
  +++ TIFFTranscoder.java	11 Mar 2002 17:34:52 -0000	1.3
  @@ -34,7 +34,7 @@
    * This class is an <tt>ImageTranscoder</tt> that produces a TIFF image.
    *
    * @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
  - * @version $Id: TIFFTranscoder.java,v 1.2 2002/03/07 22:07:44 deweese Exp $
  + * @version $Id: TIFFTranscoder.java,v 1.3 2002/03/11 17:34:52 deweese Exp $
    */
   public class TIFFTranscoder extends ImageTranscoder {
   
  @@ -73,7 +73,7 @@
   
           float pixToMM = userAgent.getPixelToMM();
           // Pixs in 100 Meters
  -        int numPix      = (int)(pixToMM*(1000*100)+0.5); 
  +        int numPix      = (int)((1000*100)/pixToMM+0.5); 
           int denom       = 100*100;  // Centimeters per 100 Meters;
           long [] rational = {(long)numPix, (long)denom};
           TIFFField [] fields = {
  
  
  

---------------------------------------------------------------------
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