: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
"HOME": "/home/web_user",
if (ENV[x] === undefined) delete env[x];else env[x] = ENV[x];
strings.push(`${x}=${env[x]}`);
getEnvStrings.strings = strings;
return getEnvStrings.strings;
var stringToAscii = (str, buffer) => {
for (var i = 0; i < str.length; ++i) {
HEAP8[buffer++] = str.charCodeAt(i);
var _environ_get = (__environ, environ_buf) => {
getEnvStrings().forEach((string, i) => {
var ptr = environ_buf + bufSize;
HEAPU32[__environ + i * 4 >> 2] = ptr;
stringToAscii(string, ptr);
bufSize += string.length + 1;
var _environ_sizes_get = (penviron_count, penviron_buf_size) => {
var strings = getEnvStrings();
HEAPU32[penviron_count >> 2] = strings.length;
strings.forEach(string => bufSize += string.length + 1);
HEAPU32[penviron_buf_size >> 2] = bufSize;
var printCharBuffers = [null, [], []];
var UTF8Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : undefined;
var UTF8ArrayToString = (heapOrArray, idx, maxBytesToRead) => {
var endIdx = idx + maxBytesToRead;
while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr;
if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));
var u0 = heapOrArray[idx++];
str += String.fromCharCode(u0);
var u1 = heapOrArray[idx++] & 63;
str += String.fromCharCode((u0 & 31) << 6 | u1);
var u2 = heapOrArray[idx++] & 63;
u0 = (u0 & 15) << 12 | u1 << 6 | u2;
u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63;
str += String.fromCharCode(u0);
str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023);
var printChar = (stream, curr) => {
var buffer = printCharBuffers[stream];
if (curr === 0 || curr === 10) {
(stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0));
var UTF8ToString = (ptr, maxBytesToRead) => ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
var _fd_write = (fd, iov, iovcnt, pnum) => {
for (var i = 0; i < iovcnt; i++) {
var ptr = HEAPU32[iov >> 2];
var len = HEAPU32[iov + 4 >> 2];
for (var j = 0; j < len; j++) {
printChar(fd, HEAPU8[ptr + j]);
HEAPU32[pnum >> 2] = num;
function _jsPrintWarning(message_ptr) {
const message = UTF8ToString(message_ptr);
(Module.warn || console.warn)(`OpenJPEG: ${message}`);
function _setImageData(array_ptr, array_size) {
Module.imageData = new Uint8ClampedArray(Module.HEAPU8.subarray(array_ptr, array_ptr + array_size));
function _storeErrorMessage(message_ptr) {
const message = UTF8ToString(message_ptr);
if (!Module.errorMessages) {
Module.errorMessages = message;
Module.errorMessages += "\n" + message;
f: __emscripten_memcpy_js,
b: _emscripten_resize_heap,
var wasmExports = createWasm();
var ___wasm_call_ctors = wasmExports["j"];
var _malloc = Module["_malloc"] = wasmExports["k"];
var _free = Module["_free"] = wasmExports["l"];
var _jp2_decode = Module["_jp2_decode"] = wasmExports["n"];
var __emscripten_stack_restore = wasmExports["_emscripten_stack_restore"];
var __emscripten_stack_alloc = wasmExports["_emscripten_stack_alloc"];
var _emscripten_stack_get_current = wasmExports["emscripten_stack_get_current"];
dependenciesFulfilled = function runCaller() {
if (!calledRun) dependenciesFulfilled = runCaller;
if (runDependencies > 0) {
if (runDependencies > 0) {
Module["calledRun"] = true;
readyPromiseResolve(Module);
if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"]();
if (Module["setStatus"]) {
Module["setStatus"]("Running...");
if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]];
while (Module["preInit"].length > 0) {
Module["preInit"].pop()();
/* harmony default export */ const openjpeg = (OpenJPEG);
;// CONCATENATED MODULE: ./src/core/jpx.js
class JpxError extends BaseException {
static decode(data, ignoreColorSpace = false) {
this.#module ||= openjpeg({
const imageData = this.#module.decode(data, ignoreColorSpace);
if (typeof imageData === "string") {
throw new JpxError(imageData);
static parseImageProperties(stream) {
let newByte = stream.getByte();
newByte = stream.getByte();
const code = oldByte << 8 | newByte;
const Xsiz = stream.getInt32() >>> 0;
const Ysiz = stream.getInt32() >>> 0;
const XOsiz = stream.getInt32() >>> 0;
const YOsiz = stream.getInt32() >>> 0;
const Csiz = stream.getUint16();
throw new JpxError("No size marker found in JPX stream");
;// CONCATENATED MODULE: ./src/core/jpx_stream.js
class JpxStream extends DecodeStream {
constructor(stream, maybeLength, params) {
this.maybeLength = maybeLength;
return shadow(this, "bytes", this.stream.getBytes(this.maybeLength));
ensureBuffer(requested) {}
readBlock(ignoreColorSpace) {
this.buffer = JpxImage.decode(this.bytes, ignoreColorSpace);
this.bufferLength = this.buffer.length;
;// CONCATENATED MODULE: ./src/core/lzw_stream.js
class LZWStream extends DecodeStream {
constructor(str, maybeLength, earlyChange) {
const maxLzwDictionarySize = 4096;
dictionaryValues: new Uint8Array(maxLzwDictionarySize),
dictionaryLengths: new Uint16Array(maxLzwDictionarySize),
dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize),
currentSequence: new Uint8Array(maxLzwDictionarySize),
for (let i = 0; i < 256; ++i) {
lzwState.dictionaryValues[i] = i;
lzwState.dictionaryLengths[i] = 1;
this.lzwState = lzwState;
let bitsCached = this.bitsCached;
let cachedData = this.cachedData;
const c = this.str.getByte();
cachedData = cachedData << 8 | c;
this.bitsCached = bitsCached -= n;
this.cachedData = cachedData;
return cachedData >>> bitsCached & (1 << n) - 1;
decodedSizeDelta = blockSize;
let estimatedDecodedSize = blockSize * 2;
const lzwState = this.lzwState;
const earlyChange = lzwState.earlyChange;
let nextCode = lzwState.nextCode;
const dictionaryValues = lzwState.dictionaryValues;
const dictionaryLengths = lzwState.dictionaryLengths;
const dictionaryPrevCodes = lzwState.dictionaryPrevCodes;
let codeLength = lzwState.codeLength;
let prevCode = lzwState.prevCode;
const currentSequence = lzwState.currentSequence;
let currentSequenceLength = lzwState.currentSequenceLength;
let currentBufferLength = this.bufferLength;
let buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);
for (i = 0; i < blockSize; i++) {
const code = this.readBits(codeLength);
const hasPrev = currentSequenceLength > 0;
currentSequence[0] = code;
currentSequenceLength = 1;
} else if (code >= 258) {
currentSequenceLength = dictionaryLengths[code];
for (j = currentSequenceLength - 1, q = code; j >= 0; j--) {
currentSequence[j] = dictionaryValues[q];
q = dictionaryPrevCodes[q];
currentSequence[currentSequenceLength++] = currentSequence[0];
} else if (code === 256) {
currentSequenceLength = 0;
dictionaryPrevCodes[nextCode] = prevCode;
dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1;
dictionaryValues[nextCode] = currentSequence[0];
codeLength = nextCode + earlyChange & nextCode + earlyChange - 1 ? codeLength : Math.min(Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1, 12) | 0;
decodedLength += currentSequenceLength;
if (estimatedDecodedSize < decodedLength) {
estimatedDecodedSize += decodedSizeDelta;
} while (estimatedDecodedSize < decodedLength);
buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);
for (j = 0; j < currentSequenceLength; j++) {
buffer[currentBufferLength++] = currentSequence[j];
lzwState.nextCode = nextCode;
lzwState.codeLength = codeLength;
lzwState.prevCode = prevCode;
lzwState.currentSequenceLength = currentSequenceLength;
this.bufferLength = currentBufferLength;
;// CONCATENATED MODULE: ./src/core/predictor_stream.js
class PredictorStream extends DecodeStream {
constructor(str, maybeLength, params) {
if (!(params instanceof Dict)) {
const predictor = this.predictor = params.get("Predictor") || 1;
if (predictor !== 2 && (predictor < 10 || predictor > 15)) {
throw new FormatError(`Unsupported predictor: ${predictor}`);
this.readBlock = predictor === 2 ? this.readBlockTiff : this.readBlockPng;
const colors = this.colors = params.get("Colors") || 1;
const bits = this.bits = params.get("BPC", "BitsPerComponent") || 8;
const columns = this.columns = params.get("Columns") || 1;
this.pixBytes = colors * bits + 7 >> 3;
this.rowBytes = columns * colors * bits + 7 >> 3;
const rowBytes = this.rowBytes;
const bufferLength = this.bufferLength;
const buffer = this.ensureBuffer(bufferLength + rowBytes);
const colors = this.colors;
const rawBytes = this.str.getBytes(rowBytes);
this.eof = !rawBytes.length;
if (bits === 1 && colors === 1) {
for (i = 0; i < rowBytes; ++i) {
let c = rawBytes[i] ^ inbuf;
for (i = 0; i < colors; ++i) {
buffer[pos++] = rawBytes[i];
for (; i < rowBytes; ++i) {
buffer[pos] = buffer[pos - colors] + rawBytes[i];
} else if (bits === 16) {
const bytesPerPixel = colors * 2;
for (i = 0; i < bytesPerPixel; ++i) {
buffer[pos++] = rawBytes[i];
for (; i < rowBytes; i += 2) {
const sum = ((rawBytes[i] & 0xff) << 8) + (rawBytes[i + 1] & 0xff) + ((buffer[pos - bytesPerPixel] & 0xff) << 8) + (buffer[pos - bytesPerPixel + 1] & 0xff);
buffer[pos++] = sum >> 8 & 0xff;
buffer[pos++] = sum & 0xff;
const compArray = new Uint8Array(colors + 1);
const bitMask = (1 << bits) - 1;
const columns = this.columns;
for (i = 0; i < columns; ++i) {
for (let kk = 0; kk < colors; ++kk) {
inbuf = inbuf << 8 | rawBytes[j++] & 0xff;
compArray[kk] = compArray[kk] + (inbuf >> inbits - bits) & bitMask;
outbuf = outbuf << bits | compArray[kk];
buffer[k++] = outbuf >> outbits - 8 & 0xff;
buffer[k++] = (outbuf << 8 - outbits) + (inbuf & (1 << 8 - outbits) - 1);
this.bufferLength += rowBytes;
const rowBytes = this.rowBytes;
const pixBytes = this.pixBytes;
const predictor = this.str.getByte();
const rawBytes = this.str.getBytes(rowBytes);
this.eof = !rawBytes.length;
const bufferLength = this.bufferLength;
const buffer = this.ensureBuffer(bufferLength + rowBytes);
let prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength);
if (prevRow.length === 0) {
prevRow = new Uint8Array(rowBytes);