From 77e900da111fa7a8cbce90c21d219cc9042e0b02 Mon Sep 17 00:00:00 2001 From: Saebekassebil Date: Tue, 3 Jan 2012 19:11:13 +0100 Subject: [PATCH 1/3] Add #findTableCode to CCITTFaxStream's prototype, fixing issue #1015 --- src/stream.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/stream.js b/src/stream.js index d996f5c91..5397830e2 100644 --- a/src/stream.js +++ b/src/stream.js @@ -1856,8 +1856,9 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { // values. The first array element indicates whether a valid code is being // returned. The second array element is the actual code. The third array // element indicates whether EOF was reached. - var findTableCode = function ccittFaxStreamFindTableCode(start, end, table, - limit) { + CCITTFaxStream.prototype.findTableCode = + function ccittFaxStreamFindTableCode(start, end, table, limit) { + var limitValue = limit || 0; for (var i = start; i <= end; ++i) { @@ -1890,7 +1891,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { return p[1]; } } else { - var result = findTableCode(1, 7, twoDimTable); + var result = this.findTableCode(1, 7, twoDimTable); if (result[0] && result[2]) return result[1]; } @@ -1919,11 +1920,11 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { return p[1]; } } else { - var result = findTableCode(1, 9, whiteTable2); + var result = this.findTableCode.call(1, 9, whiteTable2); if (result[0]) return result[1]; - result = findTableCode(11, 12, whiteTable1); + result = this.findTableCode(11, 12, whiteTable1); if (result[0]) return result[1]; } @@ -1952,15 +1953,15 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { return p[1]; } } else { - var result = findTableCode(2, 6, blackTable3); + var result = this.findTableCode(2, 6, blackTable3); if (result[0]) return result[1]; - result = findTableCode(7, 12, blackTable2, 64); + result = this.findTableCode(7, 12, blackTable2, 64); if (result[0]) return result[1]; - result = findTableCode(10, 13, blackTable1); + result = this.findTableCode(10, 13, blackTable1); if (result[0]) return result[1]; } From 7fd0dbbc172a127398ae2867d13f1bf890f1c00a Mon Sep 17 00:00:00 2001 From: Saebekassebil Date: Tue, 3 Jan 2012 19:38:45 +0100 Subject: [PATCH 2/3] Typdoh --- src/stream.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/stream.js b/src/stream.js index 5397830e2..8d3f0f5bb 100644 --- a/src/stream.js +++ b/src/stream.js @@ -1860,7 +1860,6 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { function ccittFaxStreamFindTableCode(start, end, table, limit) { var limitValue = limit || 0; - for (var i = start; i <= end; ++i) { var code = this.lookBits(i); if (code == EOF) @@ -1920,7 +1919,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { return p[1]; } } else { - var result = this.findTableCode.call(1, 9, whiteTable2); + var result = this.findTableCode(1, 9, whiteTable2); if (result[0]) return result[1]; From 8635a694a23ab621f669152c8ba672342e1cbddb Mon Sep 17 00:00:00 2001 From: Artur Adib Date: Wed, 4 Jan 2012 14:49:37 -0500 Subject: [PATCH 3/3] Adding test PDF --- test/pdfs/issue1015.pdf.link | 1 + test/test_manifest.json | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 test/pdfs/issue1015.pdf.link diff --git a/test/pdfs/issue1015.pdf.link b/test/pdfs/issue1015.pdf.link new file mode 100644 index 000000000..0878ab443 --- /dev/null +++ b/test/pdfs/issue1015.pdf.link @@ -0,0 +1 @@ +http://faculty.washington.edu/fidelr/RayaPubs/TheCaseStudyMethod.pdf diff --git a/test/test_manifest.json b/test/test_manifest.json index dbb83604b..684f7aa2d 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -381,5 +381,12 @@ "md5": "7e6027a02ff78577f74dccdf84e37189", "rounds": 1, "type": "eq" + }, + { "id": "issue1015", + "file": "pdfs/issue1015.pdf", + "md5": "b61503d1b445742b665212866afb60e2", + "rounds": 1, + "link": true, + "type": "eq" } ]