Rob Wu
43847d7ff8
Set eof to true at the end of a FlateStream
...
At the initialization of `Lexer_getObj` (in `parser.js`), there's a loop
that skips whitespace and breaks out whenever EOF is encountered.
(https://github.com/mozilla/pdf.js/blob/88ec2bd1a/src/core/parser.js#L586-L599 )
Whenever the current character is not a whitespace character,
`ch = this.nextChar();` is used to find the next character
(using `return this.currentChar = this.stream.getByte())`).
The aforementioned `getByte` method retrieves the next byte using
(https://github.com/mozilla/pdf.js/blob/88ec2bd1a/src/core/stream.js#L122-L128 )
var pos = this.pos;
while (this.bufferLength <= pos) {
if (this.eof)
return -1;
this.readBlock();
}
return this.buffer[this.pos++];
This piece of code relies on this.eof to detect whether the last character
has been read. When the stream is a `FlateStream`, and the end of the stream
has been reached, then **`this.eof` is not set to `true`**, because this check
is done inside a loop that does not occur when the read block size is zero:
(https://github.com/mozilla/pdf.js/blob/88ec2bd1ac/src/core/stream.js#L511-L517 )
for (var n = bufferLength; n < end; ++n) {
if (typeof (b = bytes[bytesPos++]) == 'undefined') {
this.eof = true;
break;
}
buffer[n] = b;
}
This commit fixes the issue by setting this.eof to true whenever the loop is not
going to run (i.e. when bufferLength === end, i.e. blockLen === 0).
12 years ago
Yury Delendik
c8af2565f1
Uses blob URL instead of data when possible
12 years ago
Brendan Dahl
5ecce4996b
Split files into worker and main thread pieces.
12 years ago
Yury Delendik
8ee9db45ef
Fixes ASCIIHex decoding
12 years ago
Yury Delendik
19e8f2f059
lookChar refactoring
12 years ago
Brendan Dahl
09aafa830b
Remove caching of stream data and fix object loader for streams.
12 years ago
Yury Delendik
5e5b66f688
Removes browser decoding optimization for JPEG CMYK
12 years ago
Yury Delendik
c099d6ba94
Removes AES padding
12 years ago
Yury Delendik
aac0f80aad
#1277 : ignoring error for bad "empty" block
12 years ago
Yury Delendik
4d9ee7b530
#2098 : scanning for stream length when it's incorrect
12 years ago
Yury Delendik
c68d125f17
Improves search of EI (end of inlined image)
12 years ago
eug48
c195daf85e
Remove stream.parameters which wasn't being set consistently. Fixes issue #2881 .
12 years ago
Mack Duan
dbccbaaa27
Make getOperatorList() calls independent and merge queues at end
12 years ago
Yury Delendik
5cf0d8fa80
Enforces maxlen for jshint
12 years ago
Jon Buckley
4a292a310f
Issue #2008 - Fix lint errors for src/stream.js
12 years ago
Yury Delendik
d71c702dcf
Removes "too many inline images" limit
13 years ago
Saebekassebil
58d6974bf5
Implement NullStream, fix #1832
13 years ago
Brendan Dahl
332ae4ce41
Change to the Apache v2 license.
13 years ago
Brendan Dahl
e6b75f4a56
Also check abbreviation for colorspace in jpegs.
13 years ago
Yury Delendik
e09eb529d9
Adds basic symbol dictionary and text region.
13 years ago
Yury Delendik
95bc99f698
Initial JBIG2 code
13 years ago
Brendan Dahl
034583e1a1
Add new severity log info(). Change severity of some log messages. Trigger fallback on errors and warnings for extension.
13 years ago
Kalervo Kujala
99440ab691
Refactor class method names.
...
Also move functionality to more logical place in canvas.js and jpx.js.
13 years ago
gigaherz
9abbce021f
Undo comment changes.
13 years ago
gigaherz
c6d7e654ee
Replace variables named 'char'=>'character', 'byte'=>'octet' and field '.private'=>'.privateData'. This allows pdf.js to compile with Google's Closure Compiler.
13 years ago
Saebekassebil
efa89ba41a
Fix issue #1302
13 years ago
notmasteryet
fcffbc3804
Fix `Line 648, E:0001: Extra space after "]"`
13 years ago
Brendan Dahl
290aa0ef5d
Fix upstream lint error.
13 years ago
notmasteryet
b73cf1b3c2
Rewrite predictor code to avoid writing into subarrays.
13 years ago
Kalervo Kujala
e3a3ec6f2e
Use JPX and JPEG in error messages.
...
Also throw in workerConsole.
13 years ago
Kalervo Kujala
66e3441e0e
Change throws to errors.
13 years ago
notmasteryet
6de2ca568d
Implements RunLengthDecode filter
13 years ago
notmasteryet
5b6c06d5c6
Address review comments
13 years ago
notmasteryet
93ca387d1b
Migration of the JPX code (from jpx5)
13 years ago
Brendan Dahl
7bf5daa273
Only set transform when its a non default.
13 years ago
Brendan Dahl
9538da2b58
Move comments.
13 years ago
Brendan Dahl
3c2a0f11b1
Decode more jpegs using the browser if possible.
13 years ago
Saebekassebil
7fd0dbbc17
Typdoh
13 years ago
Saebekassebil
77e900da11
Add #findTableCode to CCITTFaxStream's prototype, fixing issue #1015
13 years ago
Brendan Dahl
7d1cddf371
Add ability to fast track natively supported jpegs.
14 years ago
Kalervo Kujala
1ef4c94de2
Name all constructors.
14 years ago
Brendan Dahl
2a632d4ab2
First stage of trying to support smasks on native jpegs.
14 years ago
Brendan Dahl
b64b7d55b1
Use the updated jpgjs with faster transform.
14 years ago
Brendan Dahl
d2964f3e94
Update documentation.
14 years ago
Brendan Dahl
b872a08f4f
Data is now created by jpg.js since we don't know the size.
14 years ago
Brendan Dahl
073af78307
Handle device gray and pass in the color transform option.
14 years ago
Brendan Dahl
493805d952
Remove the alternative way to do CMYK check. Checking the colorspace seems sufficient.
14 years ago
Brendan Dahl
8d52a1e92a
Add another way to detect cmyk images.
14 years ago
Brendan Dahl
1869888838
Comment on the new flag.
14 years ago
Brendan Dahl
9bb2b881b0
Adds cmyk jpg support. Treats the cmyk jpg as a regular stream.
14 years ago