I don't see the problem with 1.3 on either solaris or NT
Whatever the cause of your problem its not reproducible with the test
case - once one fix is made.
I notice you aren't passing the JPEGEncodeParam parameter into the encode
method which would account for it not making a difference, but perhaps that
was an accident in distilling down your code into a test case.
-phil.
> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; m18)
Gecko/20001108 Netscape6/6.0
> X-Accept-Language: en
> Date: Sun, 18 Feb 2001 21:19:33 -0500
> From: Drew DeNardo <[EMAIL PROTECTED]>
> Subject: [JAVA2D] Trouble with affine transform
> To: [EMAIL PROTECTED]
>
> (If this is the wrong place to send this kind of message I apologize in
> advance --
> please let me know where to redirect my query and I'll not bother you again)
>
> I'm planning to build a servlet that will auto-generate thumbnails of
> the pics at my site, but am failing miserably with the scale transform.
> Can someone please tell me what I'm doing wrong here?
>
> One other strange thing -- I think I'm setting things to maintain maximum
> quality in the output image, but I'm ending up with an image that is 1/20
> the size (on disk) as the original. That sounds like some pretty aggressive
> JPEG compression to me ...
>
> To make it easier I boiled my code down to a short program.
>
> ================= BEGIN CODE ================
>
> import java.util.*;
> import java.awt.*;
> import java.awt.image.*;
> import java.awt.geom.*;
> import java.io.*;
> import com.sun.image.codec.jpeg.*;
>
> public class ImageTest
> {
> public static void main(String args[])
> {
> try
> {
> // Why isn't the result of this program a JPEG file that is
> // half the height and width of the original?
> // Of course, a 2nd question is why is the picture 1/20 the
> // size on the disk while still being the same image height
> // & width when I used "setQuality" to max on the output
> // quality ....
>
>
> InputStream in = new FileInputStream("jm.jpg");
> JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(in);
> BufferedImage inputImage = decoder.decodeAsBufferedImage();
>
> BufferedImageOp scaleFilter =
> new
> AffineTransformOp(AffineTransform.getScaleInstance(.5f,.5f),null);
>
> BufferedImage scaledImage = scaleFilter.filter(inputImage, null);
>
> OutputStream out = new FileOutputStream("jm-small.jpg");
>
> JPEGEncodeParam parms = JPEGCodec.getDefaultJPEGEncodeParam(scaledImage);
>
> parms.setQuality(1f,false);
>
> JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
>
> encoder.encode(scaledImage);
> }
> catch (Exception e)
> {
> e.printStackTrace();
> }
> }
> }
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA2D-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".