REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.73 KB
Close
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/qrcode/lib/renderer/png.js
Text
Base64
const fs = require('fs') const PNG = require('pngjs').PNG const Utils = require('./utils') exports.render = function render (qrData, options) { const opts = Utils.getOptions(options) const pngOpts = opts.rendererOpts const size = Utils.getImageWidth(qrData.modules.size, opts) pngOpts.width = size pngOpts.height = size const pngImage = new PNG(pngOpts) Utils.qrToImageData(pngImage.data, qrData, opts) return pngImage } exports.renderToDataURL = function renderToDataURL (qrData, options, cb) { if (typeof cb === 'undefined') { cb = options options = undefined } exports.renderToBuffer(qrData, options, function (err, output) { if (err) cb(err) let url = 'data:image/png;base64,' url += output.toString('base64') cb(null, url) }) } exports.renderToBuffer = function renderToBuffer (qrData, options, cb) { if (typeof cb === 'undefined') { cb = options options = undefined } const png = exports.render(qrData, options) const buffer = [] png.on('error', cb) png.on('data', function (data) { buffer.push(data) }) png.on('end', function () { cb(null, Buffer.concat(buffer)) }) png.pack() } exports.renderToFile = function renderToFile (path, qrData, options, cb) { if (typeof cb === 'undefined') { cb = options options = undefined } let called = false const done = (...args) => { if (called) return called = true cb.apply(null, args) } const stream = fs.createWriteStream(path) stream.on('error', done) stream.on('close', done) exports.renderToFileStream(stream, qrData, options) } exports.renderToFileStream = function renderToFileStream (stream, qrData, options) { const png = exports.render(qrData, options) png.pack().pipe(stream) }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 7
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
terminal
DIR
-
drwxr-xr-x
2026-02-27 09:45:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
canvas.js
1.47 KB
lrw-r--r--
2026-02-27 09:45:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
png.js
1.73 KB
lrw-r--r--
2026-02-27 09:45:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
svg-tag.js
1.92 KB
lrw-r--r--
2026-02-27 09:45:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
svg.js
532 B
lrw-r--r--
2026-02-27 09:45:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
terminal.js
271 B
lrw-r--r--
2026-02-27 09:45:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
utf8.js
1.54 KB
lrw-r--r--
2026-02-27 09:45:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
utils.js
2.83 KB
lrw-r--r--
2026-02-27 09:45:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).