aspose file tools
The moose likes Other JSE/JEE APIs and the fly likes resize outputstream Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply Bookmark "resize outputstream" Watch "resize outputstream" New topic
Author

resize outputstream

Lalit Chattar
Greenhorn

Joined: Oct 22, 2009
Posts: 11
hi everyone

i want to resize image in thimble preciew which is retrive from database as a outputsream. How we can resize outputstream in jsp.

Thank you..
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6371

You cannot resize the output stream. You need to resize the image.


SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50691

There is nothing in JSP that will help you with this. You'll need to use a Java package (perhaps JAI) that manipulates images.

Moved to a more appropriate forum.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Lalit Chattar
Greenhorn

Joined: Oct 22, 2009
Posts: 11
Deepak Bala wrote:You cannot resize the output stream. You need to resize the image.


thank you...

but i don't know how resize image in jsp. Can we temporary write image in server directory and resize then.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12612
You could just use size attributes in the image tag. If that doesn't work, you could do a normal image transform and stream the resulting bytes--you don't need to write and read and entirely new file, although by doing so you'd have a "cached" transformed image.
Rob Spoor
Saloon Keeper

Joined: Oct 27, 2005
Posts: 18365

Check out the following classes:
- ImageIO
- BufferedImage
- java.awt.Image

You can still use these without a graphical user interface.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Lalit Chattar
Greenhorn

Joined: Oct 22, 2009
Posts: 11
David Newton wrote:You could just use size attributes in the image tag. If that doesn't work, you could do a normal image transform and stream the resulting bytes--you don't need to write and read and entirely new file, although by doing so you'd have a "cached" transformed image.


thank you

can we store output stream in server temporary directory. and then display on page. if yes please tell me. How?
Rob Spoor
Saloon Keeper

Joined: Oct 27, 2005
Posts: 18365

Check out File.createTempFile.
 
 
subject: resize outputstream
 
Threads others viewed
download files from UNC using jsp
response from servlet in new window
exception
image resize
What are the IO superclasses that write to network sockets?
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture