Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Resize large jpeg without getting "Out of Memory"??

 
Matt Wilcko
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am working on a program that lets users customize advertisments... after they customize the ad, I want to display a low rez (500 x 300 pixel) version of the ad. I planned on doing this by loading their saved jpeg and using getScaledInstance().. problem is that I keep getting the error "Out of Memory" when I run it from Eclipse. The original jpegs are very large(1800 x 1200 pixels). I know I can simply reduce the size by using drawImage and specifying the size I want but the image quality isnt very good(looks blocky). Any way to get a quality reduced sized image without running out of memory?
Thanks!
-Matt
 
Dmitry Melnik
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not create a smaller image from the original you have with any picture-editing program? and then serve it to JSPs? It would save your server resources a lot.
 
Matt Wilcko
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The user needs to see a smaller version of the actual saved graphic to make sure the text on the ad(they customize it) is aligned properly. Its a standalone app.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!