Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'lzw-fix'

  • Loading branch information...
commit 1f034aa035eeadf9b9b3365e87eb52e833ded0dd 2 parents 0cd730a + 9c65c99
@yob authored
View
1  lib/pdf/reader/lzw.rb
@@ -85,6 +85,7 @@ def self.decode(data)
result = ''
until (code = stream.read) == CODE_EOD
if code == CODE_CLEAR_TABLE
+ stream.set_bits_in_chunk(9)
string_table = StringTable.new
code = stream.read
break if code == CODE_EOD
View
BIN  spec/data/lzw_compressed2.dat
Binary file not shown
View
6 spec/lzw_spec.rb
@@ -10,4 +10,10 @@
PDF::Reader::LZW.decode(content).should == '-----A---B'
end
+
+ it "should correctly decode another lzw compressed string" do
+ content = binread(File.dirname(__FILE__) + "/data/lzw_compressed2.dat")
+
+ PDF::Reader::LZW.decode(content).should match(/\ABT/)
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.