• 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:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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.
 
Marshal
Posts: 67163
169
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
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: 21463
97
Chrome Eclipse IDE Java Spring Ubuntu VI Editor 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: 21463
97
Chrome Eclipse IDE Java Spring Ubuntu VI Editor 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!