Fixes for subtile bugs that were introduced in 59283bdf6d439fdcd1a0ab07b318b48031091b34 and 99440ab6912dee9b780d28b9c425434f4afd8e44, among others.
This commit is contained in:
parent
8e50da78ee
commit
438e3c8f6d
7
external/jpgjs/jpg.js
vendored
7
external/jpgjs/jpg.js
vendored
@ -516,6 +516,10 @@ var JpegImage = (function jpegImage() {
|
|||||||
return lines;
|
return lines;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clampTo8bit(a) {
|
||||||
|
return a < 0 ? 0 : a > 255 ? 255 : a;
|
||||||
|
}
|
||||||
|
|
||||||
constructor.prototype = {
|
constructor.prototype = {
|
||||||
load: function load(path) {
|
load: function load(path) {
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
@ -766,9 +770,6 @@ var JpegImage = (function jpegImage() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getData: function getData(width, height) {
|
getData: function getData(width, height) {
|
||||||
function clampTo8bit(a) {
|
|
||||||
return a < 0 ? 0 : a > 255 ? 255 : a;
|
|
||||||
}
|
|
||||||
var scaleX = this.width / width, scaleY = this.height / height;
|
var scaleX = this.width / width, scaleY = this.height / height;
|
||||||
|
|
||||||
var component1, component2, component3, component4;
|
var component1, component2, component3, component4;
|
||||||
|
@ -179,7 +179,7 @@ var ColorSpace = (function ColorSpaceClosure() {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (n * 2 !== decode.length) {
|
if (n * 2 !== decode.length) {
|
||||||
warning('The decode map is not the correct length');
|
warn('The decode map is not the correct length');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
for (var i = 0, ii = decode.length; i < ii; i += 2) {
|
for (var i = 0, ii = decode.length; i < ii; i += 2) {
|
||||||
|
@ -222,7 +222,7 @@ var Page = (function PageClosure() {
|
|||||||
},
|
},
|
||||||
getLinks: function Page_getLinks() {
|
getLinks: function Page_getLinks() {
|
||||||
var links = [];
|
var links = [];
|
||||||
var annotations = pageGetAnnotations();
|
var annotations = this.getAnnotations();
|
||||||
var i, n = annotations.length;
|
var i, n = annotations.length;
|
||||||
for (i = 0; i < n; ++i) {
|
for (i = 0; i < n; ++i) {
|
||||||
if (annotations[i].type != 'Link')
|
if (annotations[i].type != 'Link')
|
||||||
|
@ -4671,7 +4671,7 @@ var CFFParser = (function CFFParserClosure() {
|
|||||||
|
|
||||||
var data = charstring;
|
var data = charstring;
|
||||||
var length = data.length;
|
var length = data.length;
|
||||||
for (var j = 0; j <= length; j) {
|
for (var j = 0; j <= length;) {
|
||||||
var value = data[j++];
|
var value = data[j++];
|
||||||
if (value == 12 && data[j++] == 0) {
|
if (value == 12 && data[j++] == 0) {
|
||||||
data[j - 2] = 139;
|
data[j - 2] = 139;
|
||||||
|
@ -153,7 +153,7 @@ var PDFFunction = (function PDFFunctionClosure() {
|
|||||||
var range = IR[9];
|
var range = IR[9];
|
||||||
|
|
||||||
if (m != args.length)
|
if (m != args.length)
|
||||||
error('Incorrect number of arguments: ' + inputSize + ' != ' +
|
error('Incorrect number of arguments: ' + m + ' != ' +
|
||||||
args.length);
|
args.length);
|
||||||
|
|
||||||
var x = args;
|
var x = args;
|
||||||
|
@ -220,7 +220,7 @@ var WorkerMessageHandler = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('page=%d - getOperatorList: time=%dms, len=%d', pageNum,
|
log('page=%d - getOperatorList: time=%dms, len=%d', pageNum,
|
||||||
Date.now() - start, operatorList.fnArray.length);
|
Date.now() - start, operatorList.fnArray.length);
|
||||||
|
|
||||||
// Filter the dependecies for fonts.
|
// Filter the dependecies for fonts.
|
||||||
@ -252,7 +252,7 @@ var WorkerMessageHandler = {
|
|||||||
promise.reject(e);
|
promise.reject(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('text indexing: page=%d - time=%dms',
|
log('text indexing: page=%d - time=%dms',
|
||||||
pageNum, Date.now() - start);
|
pageNum, Date.now() - start);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user