Browse Source

Remove stream.parameters which wasn't being set consistently. Fixes issue #2881.

eug48 12 years ago
parent
commit
c195daf85e
  1. 8
      src/obj.js
  2. 4
      src/parser.js
  3. 2
      src/stream.js

8
src/obj.js

@ -550,7 +550,7 @@ var XRef = (function XRefClosure() {
if (!('streamState' in this)) { if (!('streamState' in this)) {
// Stores state of the stream as we process it so we can resume // Stores state of the stream as we process it so we can resume
// from middle of stream in case of missing data error // from middle of stream in case of missing data error
var streamParameters = stream.parameters; var streamParameters = stream.dict;
var byteWidths = streamParameters.get('W'); var byteWidths = streamParameters.get('W');
var range = streamParameters.get('Index'); var range = streamParameters.get('Index');
if (!range) { if (!range) {
@ -567,7 +567,7 @@ var XRef = (function XRefClosure() {
this.readXRefStream(stream); this.readXRefStream(stream);
delete this.streamState; delete this.streamState;
return stream.parameters; return stream.dict;
}, },
readXRefStream: function XRef_readXRefStream(stream) { readXRefStream: function XRef_readXRefStream(stream) {
@ -903,8 +903,8 @@ var XRef = (function XRefClosure() {
stream = this.fetch(new Ref(tableOffset, 0)); stream = this.fetch(new Ref(tableOffset, 0));
if (!isStream(stream)) if (!isStream(stream))
error('bad ObjStm stream'); error('bad ObjStm stream');
var first = stream.parameters.get('First'); var first = stream.dict.get('First');
var n = stream.parameters.get('N'); var n = stream.dict.get('N');
if (!isInt(first) || !isInt(n)) { if (!isInt(first) || !isInt(n)) {
error('invalid first and n parameters for ObjStm stream'); error('invalid first and n parameters for ObjStm stream');
} }

4
src/parser.js

@ -180,7 +180,7 @@ var Parser = (function ParserClosure() {
if (cipherTransform) if (cipherTransform)
imageStream = cipherTransform.createStream(imageStream); imageStream = cipherTransform.createStream(imageStream);
imageStream = this.filter(imageStream, dict, length); imageStream = this.filter(imageStream, dict, length);
imageStream.parameters = dict; imageStream.dict = dict;
this.buf2 = Cmd.get('EI'); this.buf2 = Cmd.get('EI');
this.shift(); this.shift();
@ -216,7 +216,7 @@ var Parser = (function ParserClosure() {
if (cipherTransform) if (cipherTransform)
stream = cipherTransform.createStream(stream); stream = cipherTransform.createStream(stream);
stream = this.filter(stream, dict, length); stream = this.filter(stream, dict, length);
stream.parameters = dict; stream.dict = dict;
return stream; return stream;
}, },
filter: function Parser_filter(stream, dict, length) { filter: function Parser_filter(stream, dict, length) {

2
src/stream.js

@ -26,7 +26,7 @@ var Stream = (function StreamClosure() {
this.start = start || 0; this.start = start || 0;
this.pos = this.start; this.pos = this.start;
this.end = (start + length) || this.bytes.length; this.end = (start + length) || this.bytes.length;
this.parameters = this.dict = dict; this.dict = dict;
} }
// required methods for a stream. if a particular stream does not // required methods for a stream. if a particular stream does not

Loading…
Cancel
Save