Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

resize outputstream  RSS feed

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot resize the output stream. You need to resize the image.
 
Author and ninkuma
Marshal
Posts: 66806
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Lalit Chattar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 21461
96
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the following classes:
- ImageIO
- BufferedImage
- java.awt.Image

You can still use these without a graphical user interface.
 
Lalit Chattar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Sheriff
Posts: 21461
96
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out File.createTempFile.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!