tags:

views:

680

answers:

2

I have a database which contains picture data stored as a binary blob. The documentation says the data is encoded using LZW. I thought that I could decode it using the Zip or GZip input streams found in the Java library, but it didn't work - I got an exception that said the format of the data is not correct.

From what I've read, the library uses DEFLATE, which is not LZW. Also, I've read about some licensing problems for using the LZW algorithm.

What can I use to decode the data? Is there a library? Do I have to implement it myself? What about the licensing problems?

+1  A: 

Here are a couple of links:

And there are others.

Indeed if the images are LZW compressed TIFF files, The Java Advanced Imaging API apparently supports decoding directly (though not encoding it seems).

Stephen C
They are not TIFF files, they are just the image raster data, and I'm only interested in decoding. Thanks for the resources!
Andrei Vajna II
A: 

You can also try with 7-Zip JBinding which uses the 7zip library internally. It's quite easy to use.

Carlos Tasada