• Post Reply Bookmark Topic Watch Topic
  • New Topic

Image resizing as per desired size through JSP page  RSS feed

 
Anand Satyam
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSP page which browse the image file select it and upload it on the server . But I need to change the size of image before uploading it to the server .
Please Help
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before? That's can't happen without some code on the client such as an applet.
 
Anand Satyam
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i took code from the following link and its working fine ..
http://www.roseindia.net/jsp/fileupload.shtml

I am able to upload image in server and i need to resize the image when its uploaded in the server......
need help ...
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ugh. Roseindia is full of buggy code and bad practices, and this one is no exception. Stuff like this should never be done in JSPs, but in Java code.

As to image resizing, this should help: The Perils of Image.getScaledInstance(). You can create a BufferedImage from the uploaded data by using one of the javax.imageio.ImageIO.read methods.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please ask questions in the appropriate forum: this question has nothing to do with IDEs or version control. Moving to servlets (for now, although this appears to be a general Java or Swing/AWT question at this point).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!