cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject cvs commit: cocoon-2.2/src/java/org/apache/cocoon/reading ImageReader.java ResourceReader.java
Date Thu, 11 Mar 2004 18:46:26 GMT
joerg       2004/03/11 10:46:26

  Modified:    src/java/org/apache/cocoon/reading ImageReader.java
                        ResourceReader.java
  Log:
  Carsten, do you have a spaces2tabs task lying somewhere around :-P
  I guess you copied the 2.1 version to 2.2? The 2.1 version was worse in whitespace issues.
Fixed it for both.
  The 2.1 changes were already forward-ported some days ago.
  
  Revision  Changes    Path
  1.8       +26 -26    cocoon-2.2/src/java/org/apache/cocoon/reading/ImageReader.java
  
  Index: ImageReader.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/reading/ImageReader.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ImageReader.java	11 Mar 2004 14:52:04 -0000	1.7
  +++ ImageReader.java	11 Mar 2004 18:46:25 -0000	1.8
  @@ -56,17 +56,17 @@
    *     </dd>
    *     <dt>&lt;scale(Red|Green|Blue)&gt;</dt>
    *     <dd>This parameter is optional. When specified it will cause the 
  - *	specified color component in the image to be multiplied by the 
  - *	specified floating point value.
  + *         specified color component in the image to be multiplied by the 
  + *         specified floating point value.
    *     </dd>
    *     <dt>&lt;offset(Red|Green|Blue)&gt;</dt>
    *     <dd>This parameter is optional. When specified it will cause the 
  - *	specified color component in the image to be incremented by the 
  - *	specified floating point value.
  + *         specified color component in the image to be incremented by the 
  + *         specified floating point value.
    *     </dd>
    *     <dt>&lt;grayscale&gt;</dt>
    *     <dd>This parameter is optional. When specified and set to true it
  - *	will cause each image pixel to be normalized. 
  + *         will cause each image pixel to be normalized. 
    *     </dd>
    *   </dl>
    *
  @@ -105,7 +105,7 @@
           scaleColor[2] = par.getParameterAsFloat("scaleBlue", -1.0f);
           offsetColor[0] = par.getParameterAsFloat("offsetRed", 0.0f);
           offsetColor[1] = par.getParameterAsFloat("offsetGreen", 0.0f);
  -        offsetColor[2] = par.getParameterAsFloat("offsetBlue", 0.0f);	
  +        offsetColor[2] = par.getParameterAsFloat("offsetBlue", 0.0f);
   
           boolean filterColor = false;
   
  @@ -119,7 +119,7 @@
                   filterColor = true;
               }
           }
  -        
  +
           if (filterColor) {
               colorFilter = new RescaleOp(scaleColor, offsetColor, null);
           } else {
  @@ -131,8 +131,8 @@
               grayscaleFilter = new ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_GRAY),
null);
           } else {
               grayscaleFilter = null;
  -        }	
  -	
  +        }   
  +
           String enlargePar = par.getParameter("allow-enlarging", ENLARGE_DEFAULT);
           if ("true".equalsIgnoreCase(enlargePar) || "yes".equalsIgnoreCase(enlargePar)){
               enlarge = true;
  @@ -219,28 +219,28 @@
               try {
                   JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(inputStream);
                   BufferedImage original = decoder.decodeAsBufferedImage();
  -            	BufferedImage currentImage = original;
  +                BufferedImage currentImage = original;
   
  -            	if (width > 0 || height > 0) {
  -	                JPEGDecodeParam decodeParam = decoder.getJPEGDecodeParam();
  -        	        double ow = decodeParam.getWidth();
  -	                double oh = decodeParam.getHeight();
  +                if (width > 0 || height > 0) {
  +                    JPEGDecodeParam decodeParam = decoder.getJPEGDecodeParam();
  +                    double ow = decodeParam.getWidth();
  +                    double oh = decodeParam.getHeight();
   
  -	                AffineTransformOp filter = new AffineTransformOp(getTransform(ow, oh,
width, height), AffineTransformOp.TYPE_BILINEAR);
  -        	        WritableRaster scaledRaster = filter.createCompatibleDestRaster(currentImage.getRaster());
  +                    AffineTransformOp filter = new AffineTransformOp(getTransform(ow, oh,
width, height), AffineTransformOp.TYPE_BILINEAR);
  +                    WritableRaster scaledRaster = filter.createCompatibleDestRaster(currentImage.getRaster());
   
  -	                filter.filter(currentImage.getRaster(), scaledRaster);
  +                    filter.filter(currentImage.getRaster(), scaledRaster);
   
  -	                currentImage = new BufferedImage(original.getColorModel(), scaledRaster,
true, null);
  -            	}
  +                    currentImage = new BufferedImage(original.getColorModel(), scaledRaster,
true, null);
  +                }
   
  -            	if (null != grayscaleFilter) {
  -            	    grayscaleFilter.filter(currentImage, currentImage);
  -            	}
  +                if (null != grayscaleFilter) {
  +                    grayscaleFilter.filter(currentImage, currentImage);
  +                }
   
  -            	if (null != colorFilter) {
  -            	    colorFilter.filter(currentImage, currentImage);
  -            	}
  +                if (null != colorFilter) {
  +                    colorFilter.filter(currentImage, currentImage);
  +                }
   
                   if (!handleJVMBug()) {
                       if (getLogger().isDebugEnabled()) {
  
  
  
  1.9       +3 -3      cocoon-2.2/src/java/org/apache/cocoon/reading/ResourceReader.java
  
  Index: ResourceReader.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/reading/ResourceReader.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ResourceReader.java	11 Mar 2004 14:52:04 -0000	1.8
  +++ ResourceReader.java	11 Mar 2004 18:46:25 -0000	1.9
  @@ -266,12 +266,12 @@
               else {
                   response.addHeader("Vary", "Host");
               }
  -            
  +
               long lastModified = getLastModified();
               if (lastModified > 0) {
                   response.setDateHeader("Last-Modified", lastModified);
               }
  -            
  +
               try {
                   inputStream = inputSource.getInputStream();
               }
  
  
  

Mime
View raw message