From: Ryan Davis Date: 2010-03-22T17:20:20+09:00 Subject: Re: Decompressing LZW compression from PDF file On Mar 22, 2010, at 00:32 , Ahmad Azizan wrote: > With a small input, I can decompress the it to get the equivalent output > like the python code. > e.g: > Python > data = "\x80\x0b\x60\x50\x22\x0c\x0c\x85\x01" > tmp = LZWDecode(data) > print tmp > > data = "\x80\x0b\x60\x50\x22\x0c\x0c\x85\x01" > lzw = LZWDecoder.new(data) > puts lzw.run() > > However, with a real stream from PDF file, I cannot get the decompressed > output. I guess it might be some error in the code or improper handling > of special character in ruby. Can you get the python code to decode the real stream? That'd be one way to determine if the original data is corrupt or not.