wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes image manipulation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "image manipulation" Watch "image manipulation" New topic
Author

image manipulation

Dieter Merlin
Greenhorn

Joined: Oct 25, 2005
Posts: 9
Hi,

I have some code to create thumbnails of pictures anddisplay them on a site.
The problem is that we run into an outofmemoryerror every 2 weeks or so. (heap size = 512mb)

The average picture size is +- 1 MB

Here is the current code;





I know that the ImageIcon(byte[] data).getImage() holds a reference to the data but using Toolkit.createImage fails to work (black image)
and using ImageIO.read() doesnt help with the OOM either.

Avoiding the BAOS and writing the thumb directly to the ServletOutputStream causes 100% cpu usage and prevents the picture to be loaded.

I'm a little desperate on this since I cant find anything usefull that would help.

Thanks in advance
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

As the servlet API has no means of image manipulation, this has been moved to the AWT forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dieter Merlin
Greenhorn

Joined: Oct 25, 2005
Posts: 9
sorry, its just because we do it from a servlet in a jboss container that I thought it should be there, that it could have a meaning to it
 
jQuery in Action, 2nd edition
 
subject: image manipulation
 
Similar Threads
Thumbnail
image resizing
Calling of a PHP file in JSP
Thumbnail
java.awt.Toolkit in linux