mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:40:44 +00:00
refactor: trim media helper exports
This commit is contained in:
@@ -17,7 +17,7 @@ const CRC_TABLE = (() => {
|
||||
})();
|
||||
|
||||
/** Compute CRC32 checksum for a buffer (used in PNG chunk encoding). */
|
||||
export function crc32(buf: Buffer): number {
|
||||
function crc32(buf: Buffer): number {
|
||||
let crc = 0xffffffff;
|
||||
for (let i = 0; i < buf.length; i += 1) {
|
||||
crc = CRC_TABLE[(crc ^ buf[i]) & 0xff] ^ (crc >>> 8);
|
||||
@@ -26,7 +26,7 @@ export function crc32(buf: Buffer): number {
|
||||
}
|
||||
|
||||
/** Create a PNG chunk with type, data, and CRC. */
|
||||
export function pngChunk(type: string, data: Buffer): Buffer {
|
||||
function pngChunk(type: string, data: Buffer): Buffer {
|
||||
const typeBuf = Buffer.from(type, "ascii");
|
||||
const len = Buffer.alloc(4);
|
||||
len.writeUInt32BE(data.length, 0);
|
||||
|
||||
@@ -10,18 +10,18 @@ const MIN_QR_PNG_MARGIN_MODULES = 0;
|
||||
const MAX_QR_PNG_MARGIN_MODULES = 16;
|
||||
const QR_PNG_DATA_URL_PREFIX = "data:image/png;base64,";
|
||||
|
||||
export type QrPngRenderOptions = {
|
||||
type QrPngRenderOptions = {
|
||||
scale?: number;
|
||||
marginModules?: number;
|
||||
};
|
||||
|
||||
export type QrPngTempFileOptions = QrPngRenderOptions & {
|
||||
type QrPngTempFileOptions = QrPngRenderOptions & {
|
||||
tmpRoot: string;
|
||||
dirPrefix: string;
|
||||
fileName?: string;
|
||||
};
|
||||
|
||||
export type QrPngTempFile = {
|
||||
type QrPngTempFile = {
|
||||
filePath: string;
|
||||
dirPath: string;
|
||||
mediaLocalRoots: string[];
|
||||
|
||||
Reference in New Issue
Block a user