Posted by ajayrl
on October 18, 2007 at 3:39 AM PDT
I have written the following code inside the doGet() method of a servlet to read a TIFF image stored in a blob field in a Database and then convert it to JPEG and render it in the servlet output stream.
But the image is not rendered in the browser, and i do not encounter ant errors on the server logs.
binstr = rs.getBinaryStream("sign_area");
System.out.println("got thebinary stream from the database");
SeekableStream s = new MemoryCacheSeekableStream(binstr);
RenderedImage ri = JAI.create("stream",s);
ServletOutputStream fos1 = null;
fos1 = response.getOutputStream();
com.sun.media.jai.codec.JPEGEncodeParam JPEGparam = new com.sun.media.jai.codec.JPEGEncodeParam();
ImageEncoder encoder =ImageCodec.createImageEncoder("jpeg",fos1,JP
can any one suggest where i am going wrong. or suggest an aletrnative way to read tiff from a Database and display in a browser.