Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/invoice_pdf/node_modules/@jimp/plugin-resize/dist/ drwxr-xr-x | |
| Viewing file: Select action/file-type: "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _utils = require("@jimp/utils");
var _resize = _interopRequireDefault(require("./modules/resize"));
var _resize2 = _interopRequireDefault(require("./modules/resize2"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = () => ({
constants: {
RESIZE_NEAREST_NEIGHBOR: "nearestNeighbor",
RESIZE_BILINEAR: "bilinearInterpolation",
RESIZE_BICUBIC: "bicubicInterpolation",
RESIZE_HERMITE: "hermiteInterpolation",
RESIZE_BEZIER: "bezierInterpolation"
},
class: {
/**
* Resizes the image to a set width and height using a 2-pass bilinear algorithm
* @param {number} w the width to resize the image to (or Jimp.AUTO)
* @param {number} h the height to resize the image to (or Jimp.AUTO)
* @param {string} mode (optional) a scaling method (e.g. Jimp.RESIZE_BEZIER)
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
resize(w, h, mode, cb) {
if (typeof w !== "number" || typeof h !== "number") {
return _utils.throwError.call(this, "w and h must be numbers", cb);
}
if (typeof mode === "function" && typeof cb === "undefined") {
cb = mode;
mode = null;
}
if (w === this.constructor.AUTO && h === this.constructor.AUTO) {
return _utils.throwError.call(this, "w and h cannot both be set to auto", cb);
}
if (w === this.constructor.AUTO) {
w = this.bitmap.width * (h / this.bitmap.height);
}
if (h === this.constructor.AUTO) {
h = this.bitmap.height * (w / this.bitmap.width);
}
if (w < 0 || h < 0) {
return _utils.throwError.call(this, "w and h must be positive numbers", cb);
}
// round inputs
w = Math.round(w) || 1;
h = Math.round(h) || 1;
if (typeof _resize2.default[mode] === "function") {
const dst = {
data: Buffer.alloc(w * h * 4),
width: w,
height: h
};
_resize2.default[mode](this.bitmap, dst);
this.bitmap = dst;
} else {
const image = this;
const resize = new _resize.default(this.bitmap.width, this.bitmap.height, w, h, true, true, buffer => {
image.bitmap.data = Buffer.from(buffer);
image.bitmap.width = w;
image.bitmap.height = h;
});
resize.resize(this.bitmap.data);
}
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
}
});
exports.default = _default;
module.exports = exports.default;
module.exports.default = exports.default;
//# sourceMappingURL=index.js.map |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0335 ]-- |