Browse Source

PDF.js version 1.0.291

master v1.0.291
Yury Delendik 10 years ago
parent
commit
bb5a70c807
  1. 2
      bower.json
  2. 41
      build/pdf.combined.js
  3. 4
      build/pdf.js
  4. 41
      build/pdf.worker.js
  5. 2
      package.json

2
bower.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.0.288", "version": "1.0.291",
"keywords": [ "keywords": [
"Mozilla", "Mozilla",
"pdf", "pdf",

41
build/pdf.combined.js

@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.0.288'; PDFJS.version = '1.0.291';
PDFJS.build = '2449142'; PDFJS.build = 'e03ac80';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
@ -40652,9 +40652,27 @@ var JpegStream = (function JpegStreamClosure() {
} }
try { try {
var jpegImage = new JpegImage(); var jpegImage = new JpegImage();
if (this.colorTransform != -1) {
jpegImage.colorTransform = this.colorTransform; // checking if values needs to be transformed before conversion
if (this.dict && isArray(this.dict.get('Decode'))) {
var decodeArr = this.dict.get('Decode');
var bitsPerComponent = this.dict.get('BitsPerComponent') || 8;
var decodeArrLength = decodeArr.length;
var transform = new Int32Array(decodeArrLength);
var transformNeeded = false;
var maxValue = (1 << bitsPerComponent) - 1;
for (var i = 0; i < decodeArrLength; i += 2) {
transform[i] = ((decodeArr[i + 1] - decodeArr[i]) * 256) | 0;
transform[i + 1] = (decodeArr[i] * maxValue) | 0;
if (transform[i] !== 256 || transform[i + 1] !== 0) {
transformNeeded = true;
}
}
if (transformNeeded) {
jpegImage.decodeTransform = transform;
}
} }
jpegImage.parse(this.bytes); jpegImage.parse(this.bytes);
var data = jpegImage.getData(this.drawWidth, this.drawHeight, var data = jpegImage.getData(this.drawWidth, this.drawHeight,
/* forceRGBoutput = */true); /* forceRGBoutput = */true);
@ -43573,7 +43591,7 @@ var JpegImage = (function jpegImage() {
var scaleX = this.width / width, scaleY = this.height / height; var scaleX = this.width / width, scaleY = this.height / height;
var component, componentScaleX, componentScaleY, blocksPerScanline; var component, componentScaleX, componentScaleY, blocksPerScanline;
var x, y, i, j; var x, y, i, j, k;
var index; var index;
var offset = 0; var offset = 0;
var output; var output;
@ -43605,6 +43623,17 @@ var JpegImage = (function jpegImage() {
} }
} }
} }
// decodeTransform will contains pairs of multiplier (-256..256) and
// additive
var transform = this.decodeTransform;
if (transform) {
for (i = 0; i < dataLength;) {
for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) {
data[i] = ((data[i] * transform[k]) >> 8) + transform[k + 1];
}
}
}
return data; return data;
}, },
@ -43614,8 +43643,6 @@ var JpegImage = (function jpegImage() {
return true; return true;
} else if (this.numComponents == 3) { } else if (this.numComponents == 3) {
return true; return true;
} else if (typeof this.colorTransform !== 'undefined') {
return !!this.colorTransform;
} else { } else {
return false; return false;
} }

4
build/pdf.js

@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.0.288'; PDFJS.version = '1.0.291';
PDFJS.build = '2449142'; PDFJS.build = 'e03ac80';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it

41
build/pdf.worker.js vendored

@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.0.288'; PDFJS.version = '1.0.291';
PDFJS.build = '2449142'; PDFJS.build = 'e03ac80';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
@ -36145,9 +36145,27 @@ var JpegStream = (function JpegStreamClosure() {
} }
try { try {
var jpegImage = new JpegImage(); var jpegImage = new JpegImage();
if (this.colorTransform != -1) {
jpegImage.colorTransform = this.colorTransform; // checking if values needs to be transformed before conversion
if (this.dict && isArray(this.dict.get('Decode'))) {
var decodeArr = this.dict.get('Decode');
var bitsPerComponent = this.dict.get('BitsPerComponent') || 8;
var decodeArrLength = decodeArr.length;
var transform = new Int32Array(decodeArrLength);
var transformNeeded = false;
var maxValue = (1 << bitsPerComponent) - 1;
for (var i = 0; i < decodeArrLength; i += 2) {
transform[i] = ((decodeArr[i + 1] - decodeArr[i]) * 256) | 0;
transform[i + 1] = (decodeArr[i] * maxValue) | 0;
if (transform[i] !== 256 || transform[i + 1] !== 0) {
transformNeeded = true;
}
}
if (transformNeeded) {
jpegImage.decodeTransform = transform;
}
} }
jpegImage.parse(this.bytes); jpegImage.parse(this.bytes);
var data = jpegImage.getData(this.drawWidth, this.drawHeight, var data = jpegImage.getData(this.drawWidth, this.drawHeight,
/* forceRGBoutput = */true); /* forceRGBoutput = */true);
@ -39066,7 +39084,7 @@ var JpegImage = (function jpegImage() {
var scaleX = this.width / width, scaleY = this.height / height; var scaleX = this.width / width, scaleY = this.height / height;
var component, componentScaleX, componentScaleY, blocksPerScanline; var component, componentScaleX, componentScaleY, blocksPerScanline;
var x, y, i, j; var x, y, i, j, k;
var index; var index;
var offset = 0; var offset = 0;
var output; var output;
@ -39098,6 +39116,17 @@ var JpegImage = (function jpegImage() {
} }
} }
} }
// decodeTransform will contains pairs of multiplier (-256..256) and
// additive
var transform = this.decodeTransform;
if (transform) {
for (i = 0; i < dataLength;) {
for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) {
data[i] = ((data[i] * transform[k]) >> 8) + transform[k + 1];
}
}
}
return data; return data;
}, },
@ -39107,8 +39136,6 @@ var JpegImage = (function jpegImage() {
return true; return true;
} else if (this.numComponents == 3) { } else if (this.numComponents == 3) {
return true; return true;
} else if (typeof this.colorTransform !== 'undefined') {
return !!this.colorTransform;
} else { } else {
return false; return false;
} }

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.0.288", "version": "1.0.291",
"description": "Generic build of Mozilla's PDF.js library.", "description": "Generic build of Mozilla's PDF.js library.",
"keywords": [ "keywords": [
"Mozilla", "Mozilla",

Loading…
Cancel
Save