Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/wa.picotech.app/public_html/node_modules/qrcode/lib/renderer/ drwxr-xr-x | |
| Viewing file: Select action/file-type: const Utils = require('./utils')
function clearCanvas (ctx, canvas, size) {
ctx.clearRect(0, 0, canvas.width, canvas.height)
if (!canvas.style) canvas.style = {}
canvas.height = size
canvas.width = size
canvas.style.height = size + 'px'
canvas.style.width = size + 'px'
}
function getCanvasElement () {
try {
return document.createElement('canvas')
} catch (e) {
throw new Error('You need to specify a canvas element')
}
}
exports.render = function render (qrData, canvas, options) {
let opts = options
let canvasEl = canvas
if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {
opts = canvas
canvas = undefined
}
if (!canvas) {
canvasEl = getCanvasElement()
}
opts = Utils.getOptions(opts)
const size = Utils.getImageWidth(qrData.modules.size, opts)
const ctx = canvasEl.getContext('2d')
const image = ctx.createImageData(size, size)
Utils.qrToImageData(image.data, qrData, opts)
clearCanvas(ctx, canvasEl, size)
ctx.putImageData(image, 0, 0)
return canvasEl
}
exports.renderToDataURL = function renderToDataURL (qrData, canvas, options) {
let opts = options
if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {
opts = canvas
canvas = undefined
}
if (!opts) opts = {}
const canvasEl = exports.render(qrData, canvas, opts)
const type = opts.type || 'image/png'
const rendererOpts = opts.rendererOpts || {}
return canvasEl.toDataURL(type, rendererOpts.quality)
}
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0032 ]-- |