Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/embedpre.../assets/pdf/build
File: pdf.worker.js
"HOME": "/home/web_user",
[12500] Fix | Delete
"LANG": lang,
[12501] Fix | Delete
"_": getExecutableName()
[12502] Fix | Delete
};
[12503] Fix | Delete
for (var x in ENV) {
[12504] Fix | Delete
if (ENV[x] === undefined) delete env[x];else env[x] = ENV[x];
[12505] Fix | Delete
}
[12506] Fix | Delete
var strings = [];
[12507] Fix | Delete
for (var x in env) {
[12508] Fix | Delete
strings.push(`${x}=${env[x]}`);
[12509] Fix | Delete
}
[12510] Fix | Delete
getEnvStrings.strings = strings;
[12511] Fix | Delete
}
[12512] Fix | Delete
return getEnvStrings.strings;
[12513] Fix | Delete
};
[12514] Fix | Delete
var stringToAscii = (str, buffer) => {
[12515] Fix | Delete
for (var i = 0; i < str.length; ++i) {
[12516] Fix | Delete
HEAP8[buffer++] = str.charCodeAt(i);
[12517] Fix | Delete
}
[12518] Fix | Delete
HEAP8[buffer] = 0;
[12519] Fix | Delete
};
[12520] Fix | Delete
var _environ_get = (__environ, environ_buf) => {
[12521] Fix | Delete
var bufSize = 0;
[12522] Fix | Delete
getEnvStrings().forEach((string, i) => {
[12523] Fix | Delete
var ptr = environ_buf + bufSize;
[12524] Fix | Delete
HEAPU32[__environ + i * 4 >> 2] = ptr;
[12525] Fix | Delete
stringToAscii(string, ptr);
[12526] Fix | Delete
bufSize += string.length + 1;
[12527] Fix | Delete
});
[12528] Fix | Delete
return 0;
[12529] Fix | Delete
};
[12530] Fix | Delete
var _environ_sizes_get = (penviron_count, penviron_buf_size) => {
[12531] Fix | Delete
var strings = getEnvStrings();
[12532] Fix | Delete
HEAPU32[penviron_count >> 2] = strings.length;
[12533] Fix | Delete
var bufSize = 0;
[12534] Fix | Delete
strings.forEach(string => bufSize += string.length + 1);
[12535] Fix | Delete
HEAPU32[penviron_buf_size >> 2] = bufSize;
[12536] Fix | Delete
return 0;
[12537] Fix | Delete
};
[12538] Fix | Delete
var printCharBuffers = [null, [], []];
[12539] Fix | Delete
var UTF8Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : undefined;
[12540] Fix | Delete
var UTF8ArrayToString = (heapOrArray, idx, maxBytesToRead) => {
[12541] Fix | Delete
var endIdx = idx + maxBytesToRead;
[12542] Fix | Delete
var endPtr = idx;
[12543] Fix | Delete
while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr;
[12544] Fix | Delete
if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
[12545] Fix | Delete
return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));
[12546] Fix | Delete
}
[12547] Fix | Delete
var str = "";
[12548] Fix | Delete
while (idx < endPtr) {
[12549] Fix | Delete
var u0 = heapOrArray[idx++];
[12550] Fix | Delete
if (!(u0 & 128)) {
[12551] Fix | Delete
str += String.fromCharCode(u0);
[12552] Fix | Delete
continue;
[12553] Fix | Delete
}
[12554] Fix | Delete
var u1 = heapOrArray[idx++] & 63;
[12555] Fix | Delete
if ((u0 & 224) == 192) {
[12556] Fix | Delete
str += String.fromCharCode((u0 & 31) << 6 | u1);
[12557] Fix | Delete
continue;
[12558] Fix | Delete
}
[12559] Fix | Delete
var u2 = heapOrArray[idx++] & 63;
[12560] Fix | Delete
if ((u0 & 240) == 224) {
[12561] Fix | Delete
u0 = (u0 & 15) << 12 | u1 << 6 | u2;
[12562] Fix | Delete
} else {
[12563] Fix | Delete
u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63;
[12564] Fix | Delete
}
[12565] Fix | Delete
if (u0 < 65536) {
[12566] Fix | Delete
str += String.fromCharCode(u0);
[12567] Fix | Delete
} else {
[12568] Fix | Delete
var ch = u0 - 65536;
[12569] Fix | Delete
str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023);
[12570] Fix | Delete
}
[12571] Fix | Delete
}
[12572] Fix | Delete
return str;
[12573] Fix | Delete
};
[12574] Fix | Delete
var printChar = (stream, curr) => {
[12575] Fix | Delete
var buffer = printCharBuffers[stream];
[12576] Fix | Delete
if (curr === 0 || curr === 10) {
[12577] Fix | Delete
(stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0));
[12578] Fix | Delete
buffer.length = 0;
[12579] Fix | Delete
} else {
[12580] Fix | Delete
buffer.push(curr);
[12581] Fix | Delete
}
[12582] Fix | Delete
};
[12583] Fix | Delete
var UTF8ToString = (ptr, maxBytesToRead) => ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
[12584] Fix | Delete
var _fd_write = (fd, iov, iovcnt, pnum) => {
[12585] Fix | Delete
var num = 0;
[12586] Fix | Delete
for (var i = 0; i < iovcnt; i++) {
[12587] Fix | Delete
var ptr = HEAPU32[iov >> 2];
[12588] Fix | Delete
var len = HEAPU32[iov + 4 >> 2];
[12589] Fix | Delete
iov += 8;
[12590] Fix | Delete
for (var j = 0; j < len; j++) {
[12591] Fix | Delete
printChar(fd, HEAPU8[ptr + j]);
[12592] Fix | Delete
}
[12593] Fix | Delete
num += len;
[12594] Fix | Delete
}
[12595] Fix | Delete
HEAPU32[pnum >> 2] = num;
[12596] Fix | Delete
return 0;
[12597] Fix | Delete
};
[12598] Fix | Delete
function _jsPrintWarning(message_ptr) {
[12599] Fix | Delete
const message = UTF8ToString(message_ptr);
[12600] Fix | Delete
(Module.warn || console.warn)(`OpenJPEG: ${message}`);
[12601] Fix | Delete
}
[12602] Fix | Delete
function _setImageData(array_ptr, array_size) {
[12603] Fix | Delete
Module.imageData = new Uint8ClampedArray(Module.HEAPU8.subarray(array_ptr, array_ptr + array_size));
[12604] Fix | Delete
}
[12605] Fix | Delete
function _storeErrorMessage(message_ptr) {
[12606] Fix | Delete
const message = UTF8ToString(message_ptr);
[12607] Fix | Delete
if (!Module.errorMessages) {
[12608] Fix | Delete
Module.errorMessages = message;
[12609] Fix | Delete
} else {
[12610] Fix | Delete
Module.errorMessages += "\n" + message;
[12611] Fix | Delete
}
[12612] Fix | Delete
}
[12613] Fix | Delete
var wasmImports = {
[12614] Fix | Delete
f: __emscripten_memcpy_js,
[12615] Fix | Delete
b: _emscripten_resize_heap,
[12616] Fix | Delete
c: _environ_get,
[12617] Fix | Delete
d: _environ_sizes_get,
[12618] Fix | Delete
e: _fd_write,
[12619] Fix | Delete
g: _jsPrintWarning,
[12620] Fix | Delete
h: _setImageData,
[12621] Fix | Delete
a: _storeErrorMessage
[12622] Fix | Delete
};
[12623] Fix | Delete
var wasmExports = createWasm();
[12624] Fix | Delete
var ___wasm_call_ctors = wasmExports["j"];
[12625] Fix | Delete
var _malloc = Module["_malloc"] = wasmExports["k"];
[12626] Fix | Delete
var _free = Module["_free"] = wasmExports["l"];
[12627] Fix | Delete
var _jp2_decode = Module["_jp2_decode"] = wasmExports["n"];
[12628] Fix | Delete
var __emscripten_stack_restore = wasmExports["_emscripten_stack_restore"];
[12629] Fix | Delete
var __emscripten_stack_alloc = wasmExports["_emscripten_stack_alloc"];
[12630] Fix | Delete
var _emscripten_stack_get_current = wasmExports["emscripten_stack_get_current"];
[12631] Fix | Delete
var calledRun;
[12632] Fix | Delete
dependenciesFulfilled = function runCaller() {
[12633] Fix | Delete
if (!calledRun) run();
[12634] Fix | Delete
if (!calledRun) dependenciesFulfilled = runCaller;
[12635] Fix | Delete
};
[12636] Fix | Delete
function run() {
[12637] Fix | Delete
if (runDependencies > 0) {
[12638] Fix | Delete
return;
[12639] Fix | Delete
}
[12640] Fix | Delete
preRun();
[12641] Fix | Delete
if (runDependencies > 0) {
[12642] Fix | Delete
return;
[12643] Fix | Delete
}
[12644] Fix | Delete
function doRun() {
[12645] Fix | Delete
if (calledRun) return;
[12646] Fix | Delete
calledRun = true;
[12647] Fix | Delete
Module["calledRun"] = true;
[12648] Fix | Delete
if (ABORT) return;
[12649] Fix | Delete
initRuntime();
[12650] Fix | Delete
readyPromiseResolve(Module);
[12651] Fix | Delete
if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"]();
[12652] Fix | Delete
postRun();
[12653] Fix | Delete
}
[12654] Fix | Delete
if (Module["setStatus"]) {
[12655] Fix | Delete
Module["setStatus"]("Running...");
[12656] Fix | Delete
setTimeout(function () {
[12657] Fix | Delete
setTimeout(function () {
[12658] Fix | Delete
Module["setStatus"]("");
[12659] Fix | Delete
}, 1);
[12660] Fix | Delete
doRun();
[12661] Fix | Delete
}, 1);
[12662] Fix | Delete
} else {
[12663] Fix | Delete
doRun();
[12664] Fix | Delete
}
[12665] Fix | Delete
}
[12666] Fix | Delete
if (Module["preInit"]) {
[12667] Fix | Delete
if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]];
[12668] Fix | Delete
while (Module["preInit"].length > 0) {
[12669] Fix | Delete
Module["preInit"].pop()();
[12670] Fix | Delete
}
[12671] Fix | Delete
}
[12672] Fix | Delete
run();
[12673] Fix | Delete
moduleRtn = Module;
[12674] Fix | Delete
return moduleRtn;
[12675] Fix | Delete
};
[12676] Fix | Delete
})();
[12677] Fix | Delete
/* harmony default export */ const openjpeg = (OpenJPEG);
[12678] Fix | Delete
;// CONCATENATED MODULE: ./src/core/jpx.js
[12679] Fix | Delete
[12680] Fix | Delete
[12681] Fix | Delete
[12682] Fix | Delete
[12683] Fix | Delete
[12684] Fix | Delete
[12685] Fix | Delete
class JpxError extends BaseException {
[12686] Fix | Delete
constructor(msg) {
[12687] Fix | Delete
super(msg, "JpxError");
[12688] Fix | Delete
}
[12689] Fix | Delete
}
[12690] Fix | Delete
class JpxImage {
[12691] Fix | Delete
static #module = null;
[12692] Fix | Delete
static decode(data, ignoreColorSpace = false) {
[12693] Fix | Delete
this.#module ||= openjpeg({
[12694] Fix | Delete
warn: warn
[12695] Fix | Delete
});
[12696] Fix | Delete
const imageData = this.#module.decode(data, ignoreColorSpace);
[12697] Fix | Delete
if (typeof imageData === "string") {
[12698] Fix | Delete
throw new JpxError(imageData);
[12699] Fix | Delete
}
[12700] Fix | Delete
return imageData;
[12701] Fix | Delete
}
[12702] Fix | Delete
static cleanup() {
[12703] Fix | Delete
this.#module = null;
[12704] Fix | Delete
}
[12705] Fix | Delete
static parseImageProperties(stream) {
[12706] Fix | Delete
let newByte = stream.getByte();
[12707] Fix | Delete
while (newByte >= 0) {
[12708] Fix | Delete
const oldByte = newByte;
[12709] Fix | Delete
newByte = stream.getByte();
[12710] Fix | Delete
const code = oldByte << 8 | newByte;
[12711] Fix | Delete
if (code === 0xff51) {
[12712] Fix | Delete
stream.skip(4);
[12713] Fix | Delete
const Xsiz = stream.getInt32() >>> 0;
[12714] Fix | Delete
const Ysiz = stream.getInt32() >>> 0;
[12715] Fix | Delete
const XOsiz = stream.getInt32() >>> 0;
[12716] Fix | Delete
const YOsiz = stream.getInt32() >>> 0;
[12717] Fix | Delete
stream.skip(16);
[12718] Fix | Delete
const Csiz = stream.getUint16();
[12719] Fix | Delete
return {
[12720] Fix | Delete
width: Xsiz - XOsiz,
[12721] Fix | Delete
height: Ysiz - YOsiz,
[12722] Fix | Delete
bitsPerComponent: 8,
[12723] Fix | Delete
componentsCount: Csiz
[12724] Fix | Delete
};
[12725] Fix | Delete
}
[12726] Fix | Delete
}
[12727] Fix | Delete
throw new JpxError("No size marker found in JPX stream");
[12728] Fix | Delete
}
[12729] Fix | Delete
}
[12730] Fix | Delete
[12731] Fix | Delete
;// CONCATENATED MODULE: ./src/core/jpx_stream.js
[12732] Fix | Delete
[12733] Fix | Delete
[12734] Fix | Delete
[12735] Fix | Delete
class JpxStream extends DecodeStream {
[12736] Fix | Delete
constructor(stream, maybeLength, params) {
[12737] Fix | Delete
super(maybeLength);
[12738] Fix | Delete
this.stream = stream;
[12739] Fix | Delete
this.dict = stream.dict;
[12740] Fix | Delete
this.maybeLength = maybeLength;
[12741] Fix | Delete
this.params = params;
[12742] Fix | Delete
}
[12743] Fix | Delete
get bytes() {
[12744] Fix | Delete
return shadow(this, "bytes", this.stream.getBytes(this.maybeLength));
[12745] Fix | Delete
}
[12746] Fix | Delete
ensureBuffer(requested) {}
[12747] Fix | Delete
readBlock(ignoreColorSpace) {
[12748] Fix | Delete
if (this.eof) {
[12749] Fix | Delete
return;
[12750] Fix | Delete
}
[12751] Fix | Delete
this.buffer = JpxImage.decode(this.bytes, ignoreColorSpace);
[12752] Fix | Delete
this.bufferLength = this.buffer.length;
[12753] Fix | Delete
this.eof = true;
[12754] Fix | Delete
}
[12755] Fix | Delete
}
[12756] Fix | Delete
[12757] Fix | Delete
;// CONCATENATED MODULE: ./src/core/lzw_stream.js
[12758] Fix | Delete
[12759] Fix | Delete
[12760] Fix | Delete
[12761] Fix | Delete
[12762] Fix | Delete
[12763] Fix | Delete
[12764] Fix | Delete
[12765] Fix | Delete
class LZWStream extends DecodeStream {
[12766] Fix | Delete
constructor(str, maybeLength, earlyChange) {
[12767] Fix | Delete
super(maybeLength);
[12768] Fix | Delete
this.str = str;
[12769] Fix | Delete
this.dict = str.dict;
[12770] Fix | Delete
this.cachedData = 0;
[12771] Fix | Delete
this.bitsCached = 0;
[12772] Fix | Delete
const maxLzwDictionarySize = 4096;
[12773] Fix | Delete
const lzwState = {
[12774] Fix | Delete
earlyChange,
[12775] Fix | Delete
codeLength: 9,
[12776] Fix | Delete
nextCode: 258,
[12777] Fix | Delete
dictionaryValues: new Uint8Array(maxLzwDictionarySize),
[12778] Fix | Delete
dictionaryLengths: new Uint16Array(maxLzwDictionarySize),
[12779] Fix | Delete
dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize),
[12780] Fix | Delete
currentSequence: new Uint8Array(maxLzwDictionarySize),
[12781] Fix | Delete
currentSequenceLength: 0
[12782] Fix | Delete
};
[12783] Fix | Delete
for (let i = 0; i < 256; ++i) {
[12784] Fix | Delete
lzwState.dictionaryValues[i] = i;
[12785] Fix | Delete
lzwState.dictionaryLengths[i] = 1;
[12786] Fix | Delete
}
[12787] Fix | Delete
this.lzwState = lzwState;
[12788] Fix | Delete
}
[12789] Fix | Delete
readBits(n) {
[12790] Fix | Delete
let bitsCached = this.bitsCached;
[12791] Fix | Delete
let cachedData = this.cachedData;
[12792] Fix | Delete
while (bitsCached < n) {
[12793] Fix | Delete
const c = this.str.getByte();
[12794] Fix | Delete
if (c === -1) {
[12795] Fix | Delete
this.eof = true;
[12796] Fix | Delete
return null;
[12797] Fix | Delete
}
[12798] Fix | Delete
cachedData = cachedData << 8 | c;
[12799] Fix | Delete
bitsCached += 8;
[12800] Fix | Delete
}
[12801] Fix | Delete
this.bitsCached = bitsCached -= n;
[12802] Fix | Delete
this.cachedData = cachedData;
[12803] Fix | Delete
this.lastCode = null;
[12804] Fix | Delete
return cachedData >>> bitsCached & (1 << n) - 1;
[12805] Fix | Delete
}
[12806] Fix | Delete
readBlock() {
[12807] Fix | Delete
const blockSize = 512,
[12808] Fix | Delete
decodedSizeDelta = blockSize;
[12809] Fix | Delete
let estimatedDecodedSize = blockSize * 2;
[12810] Fix | Delete
let i, j, q;
[12811] Fix | Delete
const lzwState = this.lzwState;
[12812] Fix | Delete
if (!lzwState) {
[12813] Fix | Delete
return;
[12814] Fix | Delete
}
[12815] Fix | Delete
const earlyChange = lzwState.earlyChange;
[12816] Fix | Delete
let nextCode = lzwState.nextCode;
[12817] Fix | Delete
const dictionaryValues = lzwState.dictionaryValues;
[12818] Fix | Delete
const dictionaryLengths = lzwState.dictionaryLengths;
[12819] Fix | Delete
const dictionaryPrevCodes = lzwState.dictionaryPrevCodes;
[12820] Fix | Delete
let codeLength = lzwState.codeLength;
[12821] Fix | Delete
let prevCode = lzwState.prevCode;
[12822] Fix | Delete
const currentSequence = lzwState.currentSequence;
[12823] Fix | Delete
let currentSequenceLength = lzwState.currentSequenceLength;
[12824] Fix | Delete
let decodedLength = 0;
[12825] Fix | Delete
let currentBufferLength = this.bufferLength;
[12826] Fix | Delete
let buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);
[12827] Fix | Delete
for (i = 0; i < blockSize; i++) {
[12828] Fix | Delete
const code = this.readBits(codeLength);
[12829] Fix | Delete
const hasPrev = currentSequenceLength > 0;
[12830] Fix | Delete
if (code < 256) {
[12831] Fix | Delete
currentSequence[0] = code;
[12832] Fix | Delete
currentSequenceLength = 1;
[12833] Fix | Delete
} else if (code >= 258) {
[12834] Fix | Delete
if (code < nextCode) {
[12835] Fix | Delete
currentSequenceLength = dictionaryLengths[code];
[12836] Fix | Delete
for (j = currentSequenceLength - 1, q = code; j >= 0; j--) {
[12837] Fix | Delete
currentSequence[j] = dictionaryValues[q];
[12838] Fix | Delete
q = dictionaryPrevCodes[q];
[12839] Fix | Delete
}
[12840] Fix | Delete
} else {
[12841] Fix | Delete
currentSequence[currentSequenceLength++] = currentSequence[0];
[12842] Fix | Delete
}
[12843] Fix | Delete
} else if (code === 256) {
[12844] Fix | Delete
codeLength = 9;
[12845] Fix | Delete
nextCode = 258;
[12846] Fix | Delete
currentSequenceLength = 0;
[12847] Fix | Delete
continue;
[12848] Fix | Delete
} else {
[12849] Fix | Delete
this.eof = true;
[12850] Fix | Delete
delete this.lzwState;
[12851] Fix | Delete
break;
[12852] Fix | Delete
}
[12853] Fix | Delete
if (hasPrev) {
[12854] Fix | Delete
dictionaryPrevCodes[nextCode] = prevCode;
[12855] Fix | Delete
dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1;
[12856] Fix | Delete
dictionaryValues[nextCode] = currentSequence[0];
[12857] Fix | Delete
nextCode++;
[12858] Fix | Delete
codeLength = nextCode + earlyChange & nextCode + earlyChange - 1 ? codeLength : Math.min(Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1, 12) | 0;
[12859] Fix | Delete
}
[12860] Fix | Delete
prevCode = code;
[12861] Fix | Delete
decodedLength += currentSequenceLength;
[12862] Fix | Delete
if (estimatedDecodedSize < decodedLength) {
[12863] Fix | Delete
do {
[12864] Fix | Delete
estimatedDecodedSize += decodedSizeDelta;
[12865] Fix | Delete
} while (estimatedDecodedSize < decodedLength);
[12866] Fix | Delete
buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);
[12867] Fix | Delete
}
[12868] Fix | Delete
for (j = 0; j < currentSequenceLength; j++) {
[12869] Fix | Delete
buffer[currentBufferLength++] = currentSequence[j];
[12870] Fix | Delete
}
[12871] Fix | Delete
}
[12872] Fix | Delete
lzwState.nextCode = nextCode;
[12873] Fix | Delete
lzwState.codeLength = codeLength;
[12874] Fix | Delete
lzwState.prevCode = prevCode;
[12875] Fix | Delete
lzwState.currentSequenceLength = currentSequenceLength;
[12876] Fix | Delete
this.bufferLength = currentBufferLength;
[12877] Fix | Delete
}
[12878] Fix | Delete
}
[12879] Fix | Delete
[12880] Fix | Delete
;// CONCATENATED MODULE: ./src/core/predictor_stream.js
[12881] Fix | Delete
[12882] Fix | Delete
[12883] Fix | Delete
[12884] Fix | Delete
[12885] Fix | Delete
[12886] Fix | Delete
[12887] Fix | Delete
[12888] Fix | Delete
[12889] Fix | Delete
[12890] Fix | Delete
class PredictorStream extends DecodeStream {
[12891] Fix | Delete
constructor(str, maybeLength, params) {
[12892] Fix | Delete
super(maybeLength);
[12893] Fix | Delete
if (!(params instanceof Dict)) {
[12894] Fix | Delete
return str;
[12895] Fix | Delete
}
[12896] Fix | Delete
const predictor = this.predictor = params.get("Predictor") || 1;
[12897] Fix | Delete
if (predictor <= 1) {
[12898] Fix | Delete
return str;
[12899] Fix | Delete
}
[12900] Fix | Delete
if (predictor !== 2 && (predictor < 10 || predictor > 15)) {
[12901] Fix | Delete
throw new FormatError(`Unsupported predictor: ${predictor}`);
[12902] Fix | Delete
}
[12903] Fix | Delete
this.readBlock = predictor === 2 ? this.readBlockTiff : this.readBlockPng;
[12904] Fix | Delete
this.str = str;
[12905] Fix | Delete
this.dict = str.dict;
[12906] Fix | Delete
const colors = this.colors = params.get("Colors") || 1;
[12907] Fix | Delete
const bits = this.bits = params.get("BPC", "BitsPerComponent") || 8;
[12908] Fix | Delete
const columns = this.columns = params.get("Columns") || 1;
[12909] Fix | Delete
this.pixBytes = colors * bits + 7 >> 3;
[12910] Fix | Delete
this.rowBytes = columns * colors * bits + 7 >> 3;
[12911] Fix | Delete
return this;
[12912] Fix | Delete
}
[12913] Fix | Delete
readBlockTiff() {
[12914] Fix | Delete
const rowBytes = this.rowBytes;
[12915] Fix | Delete
const bufferLength = this.bufferLength;
[12916] Fix | Delete
const buffer = this.ensureBuffer(bufferLength + rowBytes);
[12917] Fix | Delete
const bits = this.bits;
[12918] Fix | Delete
const colors = this.colors;
[12919] Fix | Delete
const rawBytes = this.str.getBytes(rowBytes);
[12920] Fix | Delete
this.eof = !rawBytes.length;
[12921] Fix | Delete
if (this.eof) {
[12922] Fix | Delete
return;
[12923] Fix | Delete
}
[12924] Fix | Delete
let inbuf = 0,
[12925] Fix | Delete
outbuf = 0;
[12926] Fix | Delete
let inbits = 0,
[12927] Fix | Delete
outbits = 0;
[12928] Fix | Delete
let pos = bufferLength;
[12929] Fix | Delete
let i;
[12930] Fix | Delete
if (bits === 1 && colors === 1) {
[12931] Fix | Delete
for (i = 0; i < rowBytes; ++i) {
[12932] Fix | Delete
let c = rawBytes[i] ^ inbuf;
[12933] Fix | Delete
c ^= c >> 1;
[12934] Fix | Delete
c ^= c >> 2;
[12935] Fix | Delete
c ^= c >> 4;
[12936] Fix | Delete
inbuf = (c & 1) << 7;
[12937] Fix | Delete
buffer[pos++] = c;
[12938] Fix | Delete
}
[12939] Fix | Delete
} else if (bits === 8) {
[12940] Fix | Delete
for (i = 0; i < colors; ++i) {
[12941] Fix | Delete
buffer[pos++] = rawBytes[i];
[12942] Fix | Delete
}
[12943] Fix | Delete
for (; i < rowBytes; ++i) {
[12944] Fix | Delete
buffer[pos] = buffer[pos - colors] + rawBytes[i];
[12945] Fix | Delete
pos++;
[12946] Fix | Delete
}
[12947] Fix | Delete
} else if (bits === 16) {
[12948] Fix | Delete
const bytesPerPixel = colors * 2;
[12949] Fix | Delete
for (i = 0; i < bytesPerPixel; ++i) {
[12950] Fix | Delete
buffer[pos++] = rawBytes[i];
[12951] Fix | Delete
}
[12952] Fix | Delete
for (; i < rowBytes; i += 2) {
[12953] Fix | Delete
const sum = ((rawBytes[i] & 0xff) << 8) + (rawBytes[i + 1] & 0xff) + ((buffer[pos - bytesPerPixel] & 0xff) << 8) + (buffer[pos - bytesPerPixel + 1] & 0xff);
[12954] Fix | Delete
buffer[pos++] = sum >> 8 & 0xff;
[12955] Fix | Delete
buffer[pos++] = sum & 0xff;
[12956] Fix | Delete
}
[12957] Fix | Delete
} else {
[12958] Fix | Delete
const compArray = new Uint8Array(colors + 1);
[12959] Fix | Delete
const bitMask = (1 << bits) - 1;
[12960] Fix | Delete
let j = 0,
[12961] Fix | Delete
k = bufferLength;
[12962] Fix | Delete
const columns = this.columns;
[12963] Fix | Delete
for (i = 0; i < columns; ++i) {
[12964] Fix | Delete
for (let kk = 0; kk < colors; ++kk) {
[12965] Fix | Delete
if (inbits < bits) {
[12966] Fix | Delete
inbuf = inbuf << 8 | rawBytes[j++] & 0xff;
[12967] Fix | Delete
inbits += 8;
[12968] Fix | Delete
}
[12969] Fix | Delete
compArray[kk] = compArray[kk] + (inbuf >> inbits - bits) & bitMask;
[12970] Fix | Delete
inbits -= bits;
[12971] Fix | Delete
outbuf = outbuf << bits | compArray[kk];
[12972] Fix | Delete
outbits += bits;
[12973] Fix | Delete
if (outbits >= 8) {
[12974] Fix | Delete
buffer[k++] = outbuf >> outbits - 8 & 0xff;
[12975] Fix | Delete
outbits -= 8;
[12976] Fix | Delete
}
[12977] Fix | Delete
}
[12978] Fix | Delete
}
[12979] Fix | Delete
if (outbits > 0) {
[12980] Fix | Delete
buffer[k++] = (outbuf << 8 - outbits) + (inbuf & (1 << 8 - outbits) - 1);
[12981] Fix | Delete
}
[12982] Fix | Delete
}
[12983] Fix | Delete
this.bufferLength += rowBytes;
[12984] Fix | Delete
}
[12985] Fix | Delete
readBlockPng() {
[12986] Fix | Delete
const rowBytes = this.rowBytes;
[12987] Fix | Delete
const pixBytes = this.pixBytes;
[12988] Fix | Delete
const predictor = this.str.getByte();
[12989] Fix | Delete
const rawBytes = this.str.getBytes(rowBytes);
[12990] Fix | Delete
this.eof = !rawBytes.length;
[12991] Fix | Delete
if (this.eof) {
[12992] Fix | Delete
return;
[12993] Fix | Delete
}
[12994] Fix | Delete
const bufferLength = this.bufferLength;
[12995] Fix | Delete
const buffer = this.ensureBuffer(bufferLength + rowBytes);
[12996] Fix | Delete
let prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength);
[12997] Fix | Delete
if (prevRow.length === 0) {
[12998] Fix | Delete
prevRow = new Uint8Array(rowBytes);
[12999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function