Skip to content

Commit

Permalink
Fix fallback to JavaScript image decoder
Browse files Browse the repository at this point in the history
The bytes property will read the underlying stream to the end. Reset in
case the image decoder hasn't finished initializing.
  • Loading branch information
pbrant committed May 9, 2017
1 parent 7304b22 commit cdb403f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
}

var page = image.bytes;
image.stream.reset();

var data;
if (globals) {
Expand All @@ -74,6 +75,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {

var jpxImageRequest = function() {
var ary = image.bytes;
image.stream.reset();
var cs = image.dict.get('ColorSpace', 'CS');
return {
action: 'DecodeJpxStream',
Expand Down

0 comments on commit cdb403f

Please sign in to comment.