Fixes for subtile bugs that were introduced in 59283bdf6d439fdcd1a0ab07b318b48031091b34 and 99440ab6912dee9b780d28b9c425434f4afd8e44, among others.

This commit is contained in:
Pimm Hogeling 2012-08-31 13:37:44 +02:00
parent 8e50da78ee
commit 438e3c8f6d
6 changed files with 11 additions and 10 deletions

View File

@ -516,6 +516,10 @@ var JpegImage = (function jpegImage() {
return lines;
}
function clampTo8bit(a) {
return a < 0 ? 0 : a > 255 ? 255 : a;
}
constructor.prototype = {
load: function load(path) {
var xhr = new XMLHttpRequest();
@ -766,9 +770,6 @@ var JpegImage = (function jpegImage() {
}
},
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 component1, component2, component3, component4;
@ -935,4 +936,4 @@ var JpegImage = (function jpegImage() {
};
return constructor;
})();
})();

View File

@ -179,7 +179,7 @@ var ColorSpace = (function ColorSpaceClosure() {
return true;
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;
}
for (var i = 0, ii = decode.length; i < ii; i += 2) {

View File

@ -222,7 +222,7 @@ var Page = (function PageClosure() {
},
getLinks: function Page_getLinks() {
var links = [];
var annotations = pageGetAnnotations();
var annotations = this.getAnnotations();
var i, n = annotations.length;
for (i = 0; i < n; ++i) {
if (annotations[i].type != 'Link')

View File

@ -4671,7 +4671,7 @@ var CFFParser = (function CFFParserClosure() {
var data = charstring;
var length = data.length;
for (var j = 0; j <= length; j) {
for (var j = 0; j <= length;) {
var value = data[j++];
if (value == 12 && data[j++] == 0) {
data[j - 2] = 139;

View File

@ -153,7 +153,7 @@ var PDFFunction = (function PDFFunctionClosure() {
var range = IR[9];
if (m != args.length)
error('Incorrect number of arguments: ' + inputSize + ' != ' +
error('Incorrect number of arguments: ' + m + ' != ' +
args.length);
var x = args;

View File

@ -220,7 +220,7 @@ var WorkerMessageHandler = {
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);
// Filter the dependecies for fonts.
@ -252,7 +252,7 @@ var WorkerMessageHandler = {
promise.reject(e);
}
console.log('text indexing: page=%d - time=%dms',
log('text indexing: page=%d - time=%dms',
pageNum, Date.now() - start);
});
}