aspose file tools*
The moose likes Java in General and the fly likes image resizing using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "image resizing using java" Watch "image resizing using java" New topic
Author

image resizing using java

Sam Venkata
Ranch Hand

Joined: Mar 06, 2006
Posts: 68
Hi,
I was looking for a free online tool(api) to capture and resize the images and store them on the hard drive. I cam to know about Jmagick and JAI . I wanted to know if there are others and which one among these would be the best.
Can some body help me with this.
Thanks,
Samanth.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14345
    
  22

What exactly do you mean with "free online tool", do you mean a free program you can download, or do you mean an online application / web application?

Also, what exactly do you mean by "capturing" images?

Do you just need a tool to resize images, does it need to be in Java, do you want the source code too?

IrfanView is a very popular and useful image viewer which has a lot of other functions too, you can also resize images with it, but it's not a Java program and the source code is not available.

Here are some examples of Java code to resize images (you can do this with classes in the standard Java API, you don't need extra libraries such as Jmagick or JAI):

Load an image, scale it to thumbnail size and save it as JPEG
Mindprod.com - lots of info on working with images in Java
The Java Tutorial - 2D Graphics
[ June 14, 2007: Message edited by: Jesper Young ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Sam Venkata
Ranch Hand

Joined: Mar 06, 2006
Posts: 68
Jesper,
Thanks for your reply, What I exactly want is that I need to grab a picture from the jsp page and I need to resize the image and display it on the webpage again. I wanted to make use of a java class or a package that is already existing for this purpose.
I appreciate your help.

Thanks,
Samanth.
sridhar mam
Greenhorn

Joined: Jun 28, 2007
Posts: 4
hi,

I am looking for the same.

thanks,
sridhar
Sam Venkata
Ranch Hand

Joined: Mar 06, 2006
Posts: 68
Sridhar,
I started using Jmagick, it is good but it has not much of documentation and you might not be able to get a lot of help.

Samanth.
Thomas Mcfarrow
Ranch Hand

Joined: Jul 09, 2001
Posts: 137
Hi,

Why not read the file from the jsp page and use html attributes to resize it?

<img src=xxx width=XXX height=XXX>
Sam Venkata
Ranch Hand

Joined: Mar 06, 2006
Posts: 68
That way you change the way you display the image but not the actual image file size. It looks a little weired too.

Samanth.
Thomas Mcfarrow
Ranch Hand

Joined: Jul 09, 2001
Posts: 137
Hi, ok so you don't want to use the HTML attributes.

I am writing a commercial application in which I have the ability to
scale images. Here is the method to do this, with this said you will have to write logic to get the scaled height and width. This is easily done since you could get the attributes from the Image.

Sam Venkata
Ranch Hand

Joined: Mar 06, 2006
Posts: 68
Hi Thomas,
Thanks a lot.

Samanth.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: image resizing using java