How do i Create an Image from a byte[] wich i get from a Database
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Flo_Klui
Posted On:   Friday, August 27, 2004 02:53 AM

my ambition is to view a JPEG or GIF wich is stored at a DB2 DataBase (BLOB) in a browser. I implemented a servlet and fetching the data (as a ByteArrayOutputStream) from the DB is also not the problem. My prob is to create a thumbnail of the original image and send this thumb back to the browser for displaying it in a JSP. I cant't imagin how to solve this becaus my knowledge concerning Images is very raw and where is the metadata (the name is also saved in the DB....width and height is interesting) of the image Also to send the byte[] from the DB direct to the Browser don't work byte[] picArr = (byte[])attachMap.get("blobObject"); response.setContentType("image/jpeg&   More>>

my ambition is to view a JPEG or GIF wich is stored at a DB2 DataBase (BLOB) in a browser.


I implemented a servlet and fetching the data (as a ByteArrayOutputStream) from the DB is also not the problem. My prob is to create a thumbnail of the original image and send this thumb back to the browser for displaying it in a JSP.


I cant't imagin how to solve this becaus my knowledge concerning Images is very raw and where is the metadata (the name is also saved in the DB....width and height is interesting) of the image
Also to send the byte[] from the DB direct to the Browser don't work

			
byte[] picArr = (byte[])attachMap.get("blobObject");

response.setContentType("image/jpeg");

ServletOutputStream out = resp.getOutputStream();

out.write((byte[])attachMap.get("anlageobjekt"));

out.flush();

out.close();




How can i find out how big (width, height) the original Image is(for resize)?
   <<Less
About | Sitemap | Contact