Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ImageIO registering tiff

Status
Not open for further replies.

BillyKrow

Programmer
Aug 27, 2001
67
US
I've been struggling with this the whole day and it can't be that difficult. I'll narrow the problem down to one line of code:

Iterator readers = ImageIO.getImageReadersByFormatName("tif");

I've seen a million examples of using this but not one of how to register the tiff image type. For me this line returns an empty iterator and if I iterate over all available types using ImageIO.getWriterFormatNames(), tiff is not among them. I've played around with putting what I think I need in the classpath for tiff classes and using ImageIO.scanForPlugins() which is supposed to search for and load image types. I can not get this to work. This can't be this difficult.

Please help!!!
 
Depends what SDK version you're on - javax.imageio comes standard with 1.4 +, but did not come with 1.3.

I would try using the JAI.create("fileload") method on the tiff - this would return a RenderedOp - which can be converted to a BufferedImage using RenderedOp.getAsBufferedImage() .

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
I was using 1.4 but it seems in only comes with plug-ins for bmp and jpg. The toolkit adds other image types including tiff. Anyways, it looks like I'm on my way to getting this to work now.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top