atom feed8 messages in net.java.dev.jai-imageio.interestRe: [JAI-IMAGEIO] Re: javax.imageio.I...
FromSent OnAttachments
jai-...@javadesktop.orgFeb 28, 2008 2:00 am 
robert engelsFeb 28, 2008 7:14 am 
robert engelsFeb 28, 2008 7:15 am 
jai-...@javadesktop.orgFeb 28, 2008 1:42 pm 
robert engelsFeb 28, 2008 2:17 pm 
Brian BurkhalterFeb 28, 2008 2:26 pm 
jai-...@javadesktop.orgFeb 29, 2008 2:22 am 
jai-...@javadesktop.orgFeb 29, 2008 1:33 pm 
Subject:Re: [JAI-IMAGEIO] Re: javax.imageio.IIOException: Destination type from Ima
From:jai-...@javadesktop.org (jai-@javadesktop.org)
Date:Feb 28, 2008 2:00:29 am
List:net.java.dev.jai-imageio.interest

I don't need to write the png to disk -- I can just read the size direct from
the buffer. Here's why:

The big picture is 1. (Server) Create a BufferedImage, size 256x256 2. (Server) Instantiate a Graphics from the image and draw into it 3. (Server) Serialise the BufferedImage (using ImageIO) to send the data to a
client 4. (Client) Un-serialise the data (using ImageIO) back into a BufferedImage 5. (Client) Apply local changes to the BufferedImage 6. (Client) Blit BufferedImage onto user's screen

I've tried to describe steps 3+4. Obviously, I want this to be lossless. The streams I'm providing to the ImageIO are backed by a ByteBuffer (which is
trivially serialisable). I'm finding the data copied out of the buffer is between 5KB and 30KB, which
seems reasonable.

If BufferedImage implemented Serialisable, I would (probably) just use that. My alternative is to hand-serialise BufferedImage, but I'm not very happy doing
that.

The problem appears at step 4, where the reconstructed BufferedImage is 4 times
the size it needs to be and my attempts to coerce ImageIO into doing The Right
Thing meet only exceptions.

Neil. [Message sent by forum member 'nrg' (nrg)]

http://forums.java.net/jive/thread.jspa?messageID=261358