dcsimg
Reading TIF file with a servlet, converting it into JPG/GIF/PNG and write it to the Browser!
4 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Hartmut_Bernecker
Posted On:   Friday, September 21, 2001 06:06 AM

Hi,


I want to read TIF Graphics from the file system with a servlet. The servlet should convert it into another format like JPG, GIF or PNG and write it to the response outputstream to serve a browser client.



Is there any converting tool that can be used for that purpose??



Any help very appreciated!

TIA

Hartmut

Re: Reading TIF file with a servlet, converting it into JPG/GIF/PNG and write it to the Browser!

Posted By:   someimage  
Posted On:   Wednesday, July 17, 2013 01:31 AM

i think tiff converter is the converting tool you are looking for. this software can can <a href="http://www.rasteredge.com/how-to/vb-net-imaging/tiff-reading/">read tiff files</a> and also convert to various formats. very simple and powerful.

Re: Reading TIF file with a servlet, converting it into JPG/GIF/PNG and write it to the Browser!

Posted By:   Dean_McNabb  
Posted On:   Thursday, December 13, 2001 10:47 PM

I am doing this very thing at the moment. Java Advanced Imaging is what I am using. Here's some of the code:


SeekableStream s = new FileSeekableStream(new File(fileName));

TIFFDecodeParam param = null;

ImageDecoder dec = ImageCodec.createImageDecoder("tiff", s, param);

RenderedImage op1 = dec.decodeAsRenderedImage(imageToLoad);
// imageToLoad = page required

OutputStream out = socket.getOutputStream();


JPEGEncodeParam jparam = new JPEGEncodeParam();

jparam.setQuality(quality); // e.g. 0.25f


ImageEncoder encoder = ImageCodec.createImageEncoder("JPEG", out, jparam);


encoder.encode(op1);

s.close();

Re: Reading TIF file with a servlet, converting it into JPG/GIF/PNG and write it to the Browser!

Posted By:   Alex_Chaffee  
Posted On:   Wednesday, September 26, 2001 01:57 PM

Re: Reading TIF file with a servlet, converting it into JPG/GIF/PNG and write it to the Browser!

Posted By:   Denis_Navarre  
Posted On:   Friday, September 21, 2001 07:16 AM

This package may help you to read differents file formats


http://java.sun.com/products/jimi/


I never used it, so I can't help you on using it... I only used Java Advanced Imaging API to write JPEG some month ago.

About | Sitemap | Contact