The most intelligent Java IDE
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Other JSE/JEE APIs
 
RSS feed
 
New topic
Author

resize outputstream

Lalit Chattar
Greenhorn

Joined: Oct 22, 2009
Messages: 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
Messages: 4851

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
Sheriff

Joined: Jan 10, 2002
Messages: 36463

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
Messages: 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
Bartender

Joined: Sep 29, 2008
Messages: 6740

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.

Consultant/Trainer | Polyglottal Developer | Struts Committer/PMC | Struts 2 Web Application Development
Rob Prime
Bartender

Joined: Oct 27, 2005
Messages: 8707

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
Messages: 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 Prime
Bartender

Joined: Oct 27, 2005
Messages: 8707

Check out File.createTempFile.

SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
jQuery in Action
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Other JSE/JEE APIs
 
RSS feed
 
New topic
MyEclipse Enterprise Workbench

.