aspose file tools*
The moose likes Java in General and the fly likes image compression without any defect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "image compression without any defect" Watch "image compression without any defect" New topic
Author

image compression without any defect

Julie Jacob
Greenhorn

Joined: Aug 17, 2005
Posts: 20
I have an image to upload . I set the size of it. But any client can uploading any type and any size photo. my request is that, when a client send an image, then automatically compressing or resizing the sets the image size.

i sets the image size is 190X200. this is fixed size.
but the client can uploading any size of file. that receiving after, without any defect of the picture, and adjusting to the 190X200 size.

anyone to know this please give me the code
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
There are several ways to resize an image. I assume you have considered what a fixed size means to image quality if the uploaded image does not have the same aspect ratio or is smaller than the target size.

This thread gives you some starting points.


Ping & DNS - updated with new look and Ping home screen widget
Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
There are a couple of ways to load images.
ImageIO is one class that can do it for you. Its read method will give you a BufferedImage from any InputStream.

To scale an Image, you can use the getScaledInstance method.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: image compression without any defect
 
Similar Threads
image compression
How to upload only image file
File size
Image compression on client side
image resizing