Skip to content

🎥 Make videos programmatically with React

draw a waveform

Jonny Burger1276fb72ee73
diff --git a/packages/lambda/package.json b/packages/lambda/package.json
index 1aa60ec131..16460ef03d 100644
--- a/packages/lambda/package.json
+++ b/packages/lambda/package.json
@@ -52,6 +52,7 @@
"@types/prompt": "^1.1.0",
"eslint": "8.42.0",
"prettier": "3.1.1",
+ "pureimage": "^0.1.6",
"prettier-plugin-organize-imports": "3.2.4",
"ts-node": "^10.8.0",
"vitest": "0.31.1",
diff --git a/packages/lambda/src/test/integration/draw-wav.ts b/packages/lambda/src/test/integration/draw-wav.ts
new file mode 100644
index 0000000000..0ea24363e5
--- /dev/null
+++ b/packages/lambda/src/test/integration/draw-wav.ts
@@ -0,0 +1,410 @@
+import fs, {closeSync} from 'fs';
+import util from 'util';
+const PImage = require('pureimage');
+
+const DATA_START = 44;
+
+const read = util.promisify(fs.read);
+const close = util.promisify(fs.close);
+
+type Options = {
+ width: number;
+ height: number;
+ rms: boolean;
+ maximums: boolean;
+ average: boolean;
+ start: 'START';
+ end: 'END';
+ colors: {
+ maximums: string;
+ rms: string;
+ background: string;
+ };
+ filename: string;
+};
+
+type Sample = {
+ posRms?: number;
+ negRms?: number;
+ posMax?: number;
+ negMax?: number;
+};
+
+export class Wavedraw {
+ path: string;
+ header: {
+ chunkId: string;
+ chunkSize: number;
+ format: string;
+ subChunk1ID: string;
+ subChunk1Size: number;
+ audioFormat: number;
+ numChannels: number;
+ sampleRate: number;
+ byteRate: number;
+ blockAlign: number;
+ bitsPerSample: number;
+ subChunk2ID: string;
+ subChunk2Size: number;
+ length?: {seconds: number; minutes: number; hours: number};
+ } | null;
+
+ constructor(path: string) {
+ if (!path) {
+ throw new Error('path to wave file must be included in constructor');
+ }
+
+ this.path = path;
+ this.header = null;
+ }
+
+ async getHeader() {
+ if (this.header) {
+ return this.header;
+ }
+
+ const buf = Buffer.alloc(44);
+ let file;
+ try {
+ file = fs.openSync(this.path, 'r');
+ } catch (err) {
+ throw new Error(`Cannot open file of path ${this.path}`);
+ }
+
+ const result = await read(file, buf, 0, 44, 0);
+ const h = {
+ chunkId: Wavedraw.getStringBE(result.buffer.slice(0, 4)),
+ chunkSize: result.buffer.readInt32LE(4),
+ format: Wavedraw.getStringBE(result.buffer.slice(8, 12)),
+ subChunk1ID: Wavedraw.getStringBE(result.buffer.slice(12, 16)),
+ subChunk1Size: result.buffer.readInt32LE(16),
+ audioFormat: result.buffer.readUInt16LE(20),
+ numChannels: result.buffer.readUInt16LE(22),
+ sampleRate: result.buffer.readInt32LE(24),
+ byteRate: result.buffer.readInt32LE(28),
+ blockAlign: result.buffer.readUInt16LE(32),
+ bitsPerSample: result.buffer.readUInt16LE(34),
+ subChunk2ID: Wavedraw.getStringBE(result.buffer.slice(36, 40)),
+ subChunk2Size: result.buffer.readInt32LE(40),
+ };
+ this.header = h;
+ await close(file);
+ this.header.length = this.getFileLength();
+ return this.header;
+ }
+
+ static getStringBE(bytes: Buffer) {
+ const arr = Array.prototype.slice.call(bytes, 0);
+ let result = '';
+ for (let i = 0; i < arr.length; i += 1) {
+ result += String.fromCharCode(arr[i]);
+ }
+
+ return result;
+ }
+
+ getFileLength() {
+ if (!this.header) {
+ throw new Error('Cannot get file length until header is loaded');
+ }
+
+ const numSamples = parseInt(
+ (this.header.subChunk2Size / this.header.blockAlign) as unknown as string,
+ 10,
+ );
+ let seconds = parseInt(
+ (numSamples / this.header.sampleRate) as unknown as string,
+ 10,
+ );
+ const minutes = parseInt((seconds / 60) as unknown as string, 10);
+ const hours = parseInt((minutes / 60) as unknown as string, 10);
+ seconds %= 60;
+ return {
+ seconds,
+ minutes,
+ hours,
+ };
+ }
+
+ getOffsetInfo(
+ start: undefined | 'START',
+ end: undefined | 'END',
+ width: number,
+ ) {
+ let startPos;
+ let endPos;
+
+ if (start === undefined || start === 'START') {
+ startPos = DATA_START;
+ } else {
+ startPos = this.getOffset(start) + DATA_START;
+ }
+
+ if (end === undefined || end === 'END') {
+ endPos = this.header?.subChunk2Size;
+ } else {
+ endPos = this.getOffset(end);
+ }
+
+ const blockSize = parseInt(
+ (((endPos as number) - startPos) /
+ (this.header?.blockAlign as number) /
+ width) as unknown as string,
+ 10,
+ );
+ const chunkSize = parseInt(
+ // eslint-disable-next-line no-unsafe-optional-chaining
+ (blockSize * (this.header?.blockAlign as number)) as unknown as string,
+ 10,
+ );
+ return {
+ startPos,
+ endPos,
+ blockSize,
+ chunkSize,
+ };
+ }
+
+ getOffset(time: string) {
+ const [hours, minutes, seconds] = time
+ .split(':')
+ .map((unit) => parseInt(unit, 10));
+ if (hours > (this.header?.length?.hours as number)) {
+ throw new Error('Length in hours is too long');
+ } else if (minutes > (this.header?.length?.minutes as number)) {
+ throw new Error('Length in minutes is too long');
+ } else if (
+ seconds > (this.header?.length?.seconds as number) &&
+ minutes === (this.header?.length?.minutes as number)
+ ) {
+ throw new Error('Length in seconds is too long');
+ }
+
+ let adjustedSeconds = seconds + hours * 60 * 60;
+ adjustedSeconds += minutes * 60;
+ return parseInt(
+ (adjustedSeconds *
+ (this.header?.sampleRate as number) *
+ (this.header?.blockAlign as number)) as unknown as string,
+ 10,
+ );
+ }
+
+ static validateDrawWaveOptions(options: {width?: number; height?: number}) {
+ if (!(options.width && options.height)) {
+ throw new Error('drawWave() required parameters: width, height');
+ }
+ }
+
+ async drawWave(options: Options) {
+ Wavedraw.validateDrawWaveOptions(options);
+ if (!this.header) await this.getHeader();
+ if (this.header?.bitsPerSample !== 16) {
+ throw new Error('drawWave() currently only supports 16 bit audio files!');
+ }
+
+ const samples = await this.getSamples(options);
+ console.log('got samples');
+ const img1 = PImage.make(options.width, options.height);
+ const ctx = img1.getContext('2d');
+ const ceiling = 32767;
+
+ if (options.colors && options.colors.background) {
+ ctx.fillStyle = options.colors.background;
+ ctx.fillRect(0, 0, options.width, options.height);
+ }
+
+ for (let i = 0; i < options.width; i += 1) {
+ if (options.maximums) {
+ ctx.strokeStyle =
+ options.colors && options.colors.maximums
+ ? options.colors.maximums
+ : '#0000ff';
+
+ ctx.drawLine({
+ start: {
+ x: i,
+ y: Number.parseInt((options.height / 2) as unknown as string, 10),
+ },
+ end: {
+ x: i,
+ y: Number.parseInt(
+ (options.height / 2 -
+ (options.height / 2 / ceiling) *
+ (samples[i].posMax as number)) as unknown as string,
+ 10,
+ ),
+ },
+ });
+
+ ctx.drawLine({
+ start: {
+ x: i,
+ y: Number.parseInt((options.height / 2) as unknown as string, 10),
+ },
+ end: {
+ x: i,
+ y: Number.parseInt(
+ (options.height / 2 +
+ -(
+ (options.height / 2 / ceiling) *
+ (samples[i].negMax as number)
+ )) as unknown as string,
+ 10,
+ ),
+ },
+ });
+ }
+
+ if (options.rms) {
+ ctx.strokeStyle =
+ options.colors && options.colors.rms ? options.colors.rms : '#659df7';
+ ctx.drawLine({
+ start: {
+ x: i,
+ y: Number.parseInt((options.height / 2) as unknown as string, 10),
+ },
+ end: {
+ x: i,
+ y: Number.parseInt(
+ (options.height / 2 -
+ (options.height / 2 / ceiling) *
+ (samples[i].posRms as number)) as unknown as string,
+ 10,
+ ),
+ },
+ });
+
+ ctx.drawLine({
+ start: {
+ x: i,
+ y: Number.parseInt((options.height / 2) as unknown as string, 10),
+ },
+ end: {
+ x: i,
+ y: Number.parseInt(
+ (options.height / 2 +
+ -(
+ (options.height / 2 / ceiling) *
+ (samples[i].negRms as number)
+ )) as unknown as string,
+ 10,
+ ),
+ },
+ });
+ }
+ }
+
+ const filename = options.filename ? options.filename : 'wave.png';
+ await PImage.encodePNGToStream(img1, fs.createWriteStream(filename));
+ }
+
+ async getSamples(options: Options) {
+ if (!options.width) {
+ throw new Error('getSamples() required parameter: width');
+ }
+
+ if (!this.header) {
+ await this.getHeader();
+ }
+
+ const offsetInfo = this.getOffsetInfo(
+ options.start,
+ options.end,
+ options.width,
+ );
+ console.log({offsetInfo});
+ const file = fs.openSync(this.path, 'r');
+ if (!file) {
+ throw new Error(`Error opening file ${this.path}`);
+ }
+
+ const samples: Sample[] = [];
+ for (let x = 0; x < options.width; x += 1) {
+ const buf = new ArrayBuffer(offsetInfo.chunkSize);
+ const intView = new Int16Array(buf);
+ const position = offsetInfo.chunkSize * x + offsetInfo.startPos;
+ await read(file, intView, 0, offsetInfo.chunkSize, position);
+ let sampleInfo = {};
+ if (options.maximums) sampleInfo = {...Wavedraw.computeMaximums(intView)};
+ if (options.average)
+ sampleInfo = {...sampleInfo, ...Wavedraw.computeAverage(intView)};
+ if (options.rms)
+ sampleInfo = {...sampleInfo, ...Wavedraw.computeRms(intView)};
+ samples.push(sampleInfo);
+ }
+
+ console.log('closing');
+
+ closeSync(file);
+ console.log('done');
+ return samples;
+ }
+
+ static computeMaximums(inputSignal: Int16Array) {
+ return {
+ posMax: Math.max.apply(null, inputSignal as unknown as number[]),
+ negMax: Math.min.apply(null, inputSignal as unknown as number[]),
+ };
+ }
+
+ static computeRms(inputSignal: Int16Array) {
+ const positives = inputSignal.filter((x) => x >= 0);
+ const posInt32 = Int32Array.from(positives);
+ const posRms =
+ posInt32.length > 0
+ ? Math.sqrt(
+ posInt32.map((x) => x * x).reduce((a, b) => a + b, 0) /
+ posInt32.length,
+ )
+ : 0;
+ const negatives = inputSignal.filter((x) => x < 0);
+ const negInt32 = Int32Array.from(negatives);
+ const negRms =
+ negInt32.length > 0
+ ? -Math.sqrt(
+ Math.abs(negInt32.map((x) => x * x).reduce((a, b) => a + b, 0)) /
+ negInt32.length,
+ )
+ : 0;
+ return {
+ posRms,
+ negRms,
+ };
+ }
+
+ static computeAverage(inputSignal: Int16Array) {
+ const positives = inputSignal.filter((x) => x >= 0);
+ const posAvg =
+ positives.length > 0
+ ? positives.reduce((a, b) => a + b, 0) / positives.length
+ : 0;
+ const negatives = inputSignal.filter((x) => x < 0);
+ const negAvg =
+ negatives.length > 0
+ ? negatives.reduce((a, b) => a + b, 0) / negatives.length
+ : 0;
+ return {
+ posAvg,
+ negAvg,
+ };
+ }
+
+ static computeDft(inputSignal: Int16Array) {
+ const N = inputSignal.length;
+ const pi2 = Math.PI * 2.0;
+ const dftValues = [];
+ for (let i = 0; i < N; i += 1) {
+ dftValues[i] = {
+ real: 0.0,
+ imag: 0.0,
+ };
+ for (let j = 0; j < N; j += 1) {
+ dftValues[i].real += inputSignal[j] * Math.cos((pi2 * j * i) / N);
+ dftValues[i].imag += inputSignal[j] * Math.sin((pi2 * j * i) / N);
+ }
+ }
+
+ return dftValues;
+ }
+}
diff --git a/packages/lambda/src/test/integration/renders/seamless-audio.test.ts b/packages/lambda/src/test/integration/renders/seamless-audio.test.ts
index fd52d27bad..ee1b897708 100644
--- a/packages/lambda/src/test/integration/renders/seamless-audio.test.ts
+++ b/packages/lambda/src/test/integration/renders/seamless-audio.test.ts
@@ -1,10 +1,11 @@
import {RenderInternals} from '@remotion/renderer';
-import {readFileSync} from 'fs';
+import {createWriteStream} from 'fs';
import path from 'path';
import {afterAll, expect, test} from 'vitest';
import {deleteRender} from '../../../api/delete-render';
import {rendersPrefix} from '../../../defaults';
import {lambdaLs} from '../../../functions/helpers/io';
+import {Wavedraw} from '../draw-wav';
import {simulateLambdaRender} from '../simulate-lambda-render';
afterAll(async () => {
@@ -17,27 +18,54 @@ test('Should make seamless audio', async () => {
composition: 'framer',
frameRange: [100, 200],
imageFormat: 'png',
- logLevel: 'error',
+ logLevel: 'verbose',
region: 'eu-central-1',
inputProps: {playbackRate: 2},
});
+ const aac = path.join(process.cwd(), 'out.aac');
+
+ const stream = createWriteStream(aac);
+ await new Promise<void>((resolve) => {
+ file.pipe(stream).on('finish', () => {
+ resolve();
+ });
+ });
+
const wav = path.join(process.cwd(), 'test.wav');
await RenderInternals.callFf({
bin: 'ffmpeg',
- args: ['-i', '-', '-y', wav],
- options: {
- stdin: file,
- },
+ args: ['-i', aac, '-acodec', 'pcm_s16le', '-ac', '1', '-y', wav],
indent: false,
binariesDirectory: null,
cancelSignal: undefined,
logLevel: 'info',
});
- const waveForm = readFileSync(wav);
- const buf = waveForm.subarray(100000, 100000 + 2000);
+ console.log('wav');
+
+ const wd = new Wavedraw(wav);
+
+ const options = {
+ width: 600,
+ height: 300,
+ rms: true,
+ maximums: true,
+ average: false,
+ start: 'START' as const,
+ end: 'END' as const,
+ colors: {
+ maximums: '#0000ff',
+ rms: '#659df7',
+ background: '#ffffff',
+ },
+ filename: 'example1.png',
+ };
+
+ console.log('drawn');
+ await wd.drawWave(options); // outputs wave drawing to example1.png
+ console.log('drawn');
const files = await lambdaLs({
bucketName: progress.outBucket as string,
@@ -64,133 +92,4 @@ test('Should make seamless audio', async () => {
expect(expectFiles.length).toBe(0);
await close();
-
- expect(buf).toEqual(
- Buffer.from([
- 58, 245, 254, 243, 254, 243, 203, 242, 203, 242, 164, 241, 164, 241, 138,
- 240, 138, 240, 124, 239, 124, 239, 124, 238, 124, 238, 140, 237, 140, 237,
- 170, 236, 170, 236, 217, 235, 217, 235, 27, 235, 27, 235, 109, 234, 109,
- 234, 208, 233, 208, 233, 72, 233, 72, 233, 211, 232, 211, 232, 113, 232,
- 113, 232, 35, 232, 35, 232, 234, 231, 234, 231, 197, 231, 197, 231, 181,
- 231, 181, 231, 186, 231, 186, 231, 210, 231, 210, 231, 255, 231, 255, 231,
- 65, 232, 65, 232, 151, 232, 151, 232, 1, 233, 1, 233, 126, 233, 126, 233,
- 14, 234, 14, 234, 178, 234, 178, 234, 103, 235, 103, 235, 45, 236, 45,
- 236, 6, 237, 6, 237, 236, 237, 236, 237, 227, 238, 227, 238, 234, 239,
- 234, 239, 252, 240, 252, 240, 28, 242, 28, 242, 72, 243, 72, 243, 126,
- 244, 126, 244, 191, 245, 191, 245, 8, 247, 8, 247, 88, 248, 88, 248, 176,
- 249, 176, 249, 12, 251, 12, 251, 108, 252, 108, 252, 209, 253, 209, 253,
- 53, 255, 53, 255, 156, 0, 156, 0, 2, 2, 2, 2, 101, 3, 101, 3, 199, 4, 199,
- 4, 36, 6, 36, 6, 123, 7, 123, 7, 206, 8, 206, 8, 23, 10, 23, 10, 88, 11,
- 88, 11, 145, 12, 145, 12, 190, 13, 190, 13, 223, 14, 223, 14, 244, 15,
- 244, 15, 252, 16, 252, 16, 244, 17, 244, 17, 222, 18, 222, 18, 183, 19,
- 183, 19, 128, 20, 128, 20, 55, 21, 55, 21, 221, 21, 221, 21, 112, 22, 112,
- 22, 239, 22, 239, 22, 92, 23, 92, 23, 180, 23, 180, 23, 248, 23, 248, 23,
- 40, 24, 40, 24, 67, 24, 67, 24, 74, 24, 74, 24, 60, 24, 60, 24, 26, 24,
- 26, 24, 226, 23, 226, 23, 151, 23, 151, 23, 56, 23, 56, 23, 197, 22, 197,
- 22, 62, 22, 62, 22, 165, 21, 165, 21, 250, 20, 250, 20, 59, 20, 59, 20,
- 109, 19, 109, 19, 143, 18, 143, 18, 159, 17, 159, 17, 161, 16, 161, 16,
- 149, 15, 149, 15, 124, 14, 124, 14, 87, 13, 87, 13, 38, 12, 38, 12, 234,
- 10, 234, 10, 165, 9, 165, 9, 89, 8, 89, 8, 6, 7, 6, 7, 171, 5, 171, 5, 77,
- 4, 77, 4, 235, 2, 235, 2, 133, 1, 133, 1, 32, 0, 32, 0, 186, 254, 186,
- 254, 84, 253, 84, 253, 243, 251, 243, 251, 146, 250, 146, 250, 55, 249,
- 55, 249, 227, 247, 227, 247, 148, 246, 148, 246, 78, 245, 78, 245, 18,
- 244, 18, 244, 222, 242, 222, 242, 182, 241, 182, 241, 156, 240, 156, 240,
- 140, 239, 140, 239, 140, 238, 140, 238, 154, 237, 154, 237, 183, 236, 183,
- 236, 230, 235, 230, 235, 37, 235, 37, 235, 118, 234, 118, 234, 218, 233,
- 218, 233, 79, 233, 79, 233, 217, 232, 217, 232, 118, 232, 118, 232, 38,
- 232, 38, 232, 236, 231, 236, 231, 198, 231, 198, 231, 179, 231, 179, 231,
- 183, 231, 183, 231, 207, 231, 207, 231, 250, 231, 250, 231, 59, 232, 59,
- 232, 143, 232, 143, 232, 249, 232, 249, 232, 117, 233, 117, 233, 4, 234,
- 4, 234, 166, 234, 166, 234, 90, 235, 90, 235, 32, 236, 32, 236, 247, 236,
- 247, 236, 221, 237, 221, 237, 211, 238, 211, 238, 216, 239, 216, 239, 234,
- 240, 234, 240, 10, 242, 10, 242, 54, 243, 54, 243, 106, 244, 106, 244,
- 171, 245, 171, 245, 244, 246, 244, 246, 67, 248, 67, 248, 155, 249, 155,
- 249, 247, 250, 247, 250, 87, 252, 87, 252, 188, 253, 188, 253, 33, 255,
- 33, 255, 136, 0, 136, 0, 238, 1, 238, 1, 81, 3, 81, 3, 179, 4, 179, 4, 17,
- 6, 17, 6, 105, 7, 105, 7, 188, 8, 188, 8, 5, 10, 5, 10, 72, 11, 72, 11,
- 128, 12, 128, 12, 174, 13, 174, 13, 209, 14, 209, 14, 230, 15, 230, 15,
- 238, 16, 238, 16, 233, 17, 233, 17, 210, 18, 210, 18, 173, 19, 173, 19,
- 120, 20, 120, 20, 47, 21, 47, 21, 214, 21, 214, 21, 106, 22, 106, 22, 234,
- 22, 234, 22, 89, 23, 89, 23, 178, 23, 178, 23, 247, 23, 247, 23, 42, 24,
- 42, 24, 69, 24, 69, 24, 77, 24, 77, 24, 66, 24, 66, 24, 31, 24, 31, 24,
- 234, 23, 234, 23, 160, 23, 160, 23, 65, 23, 65, 23, 208, 22, 208, 22, 75,
- 22, 75, 22, 178, 21, 178, 21, 8, 21, 8, 21, 74, 20, 74, 20, 125, 19, 125,
- 19, 159, 18, 159, 18, 176, 17, 176, 17, 180, 16, 180, 16, 168, 15, 168,
- 15, 142, 14, 142, 14, 107, 13, 107, 13, 57, 12, 57, 12, 254, 10, 254, 10,
- 187, 9, 187, 9, 109, 8, 109, 8, 26, 7, 26, 7, 194, 5, 194, 5, 97, 4, 97,
- 4, 255, 2, 255, 2, 155, 1, 155, 1, 52, 0, 52, 0, 206, 254, 206, 254, 105,
- 253, 105, 253, 5, 252, 5, 252, 165, 250, 165, 250, 74, 249, 74, 249, 245,
- 247, 245, 247, 166, 246, 166, 246, 94, 245, 94, 245, 33, 244, 33, 244,
- 237, 242, 237, 242, 196, 241, 196, 241, 168, 240, 168, 240, 152, 239, 152,
- 239, 150, 238, 150, 238, 163, 237, 163, 237, 192, 236, 192, 236, 238, 235,
- 238, 235, 43, 235, 43, 235, 123, 234, 123, 234, 221, 233, 221, 233, 82,
- 233, 82, 233, 218, 232, 218, 232, 118, 232, 118, 232, 37, 232, 37, 232,
- 234, 231, 234, 231, 194, 231, 194, 231, 175, 231, 175, 231, 177, 231, 177,
- 231, 199, 231, 199, 231, 242, 231, 242, 231, 50, 232, 50, 232, 133, 232,
- 133, 232, 237, 232, 237, 232, 104, 233, 104, 233, 246, 233, 246, 233, 152,
- 234, 152, 234, 74, 235, 74, 235, 15, 236, 15, 236, 230, 236, 230, 236,
- 203, 237, 203, 237, 193, 238, 193, 238, 197, 239, 197, 239, 214, 240, 214,
- 240, 245, 241, 245, 241, 33, 243, 33, 243, 85, 244, 85, 244, 150, 245,
- 150, 245, 222, 246, 222, 246, 46, 248, 46, 248, 133, 249, 133, 249, 225,
- 250, 225, 250, 65, 252, 65, 252, 166, 253, 166, 253, 11, 255, 11, 255,
- 114, 0, 114, 0, 216, 1, 216, 1, 60, 3, 60, 3, 159, 4, 159, 4, 253, 5, 253,
- 5, 85, 7, 85, 7, 168, 8, 168, 8, 244, 9, 244, 9, 55, 11, 55, 11, 112, 12,
- 112, 12, 159, 13, 159, 13, 194, 14, 194, 14, 217, 15, 217, 15, 226, 16,
- 226, 16, 222, 17, 222, 17, 201, 18, 201, 18, 165, 19, 165, 19, 113, 20,
- 113, 20, 41, 21, 41, 21, 209, 21, 209, 21, 104, 22, 104, 22, 233, 22, 233,
- 22, 88, 23, 88, 23, 180, 23, 180, 23, 249, 23, 249, 23, 44, 24, 44, 24,
- 74, 24, 74, 24, 82, 24, 82, 24, 72, 24, 72, 24, 40, 24, 40, 24, 242, 23,
- 242, 23, 171, 23, 171, 23, 76, 23, 76, 23, 220, 22, 220, 22, 89, 22, 89,
- 22, 192, 21, 192, 21, 23, 21, 23, 21, 92, 20, 92, 20, 142, 19, 142, 19,
- 178, 18, 178, 18, 196, 17, 196, 17, 199, 16, 199, 16, 190, 15, 190, 15,
- 165, 14, 165, 14, 128, 13, 128, 13, 81, 12, 81, 12, 21, 11, 21, 11, 210,
- 9, 210, 9, 134, 8, 134, 8, 49, 7, 49, 7, 217, 5, 217, 5, 122, 4, 122, 4,
- 23, 3, 23, 3, 179, 1, 179, 1, 76, 0, 76, 0, 229, 254, 229, 254, 126, 253,
- 126, 253, 27, 252, 27, 252, 187, 250, 187, 250, 94, 249, 94, 249, 8, 248,
- 8, 248, 185, 246, 185, 246, 112, 245, 112, 245, 50, 244, 50, 244, 254,
- 242, 254, 242, 212, 241, 212, 241, 182, 240, 182, 240, 166, 239, 166, 239,
- 163, 238, 163, 238, 175, 237, 175, 237, 202, 236, 202, 236, 247, 235, 247,
- 235, 51, 235, 51, 235, 129, 234, 129, 234, 227, 233, 227, 233, 86, 233,
- 86, 233, 220, 232, 220, 232, 120, 232, 120, 232, 37, 232, 37, 232, 232,
- 231, 232, 231, 192, 231, 192, 231, 171, 231, 171, 231, 171, 231, 171, 231,
- 192, 231, 192, 231, 234, 231, 234, 231, 41, 232, 41, 232, 123, 232, 123,
- 232, 225, 232, 225, 232, 91, 233, 91, 233, 232, 233, 232, 233, 136, 234,
- 136, 234, 58, 235, 58, 235, 255, 235, 255, 235, 211, 236, 211, 236, 183,
- 237, 183, 237, 173, 238, 173, 238, 176, 239, 176, 239, 193, 240, 193, 240,
- 224, 241, 224, 241, 9, 243, 9, 243, 62, 244, 62, 244, 126, 245, 126, 245,
- 197, 246, 197, 246, 21, 248, 21, 248, 108, 249, 108, 249, 200, 250, 200,
- 250, 41, 252, 41, 252, 140, 253, 140, 253, 242, 254, 242, 254, 90, 0, 90,
- 0, 191, 1, 191, 1, 36, 3, 36, 3, 136, 4, 136, 4, 229, 5, 229, 5, 63, 7,
- 63, 7, 147, 8, 147, 8, 221, 9, 221, 9, 34, 11, 34, 11, 93, 12, 93, 12,
- 139, 13, 139, 13, 176, 14, 176, 14, 200, 15, 200, 15, 209, 16, 209, 16,
- 207, 17, 207, 17, 187, 18, 187, 18, 152, 19, 152, 19, 101, 20, 101, 20,
- 31, 21, 31, 21, 201, 21, 201, 21, 96, 22, 96, 22, 227, 22, 227, 22, 83,
- 23, 83, 23, 176, 23, 176, 23, 247, 23, 247, 23, 43, 24, 43, 24, 75, 24,
- 75, 24, 86, 24, 86, 24, 75, 24, 75, 24, 44, 24, 44, 24, 250, 23, 250, 23,
- 178, 23, 178, 23, 87, 23, 87, 23, 231, 22, 231, 22, 99, 22, 99, 22, 206,
- 21, 206, 21, 38, 21, 38, 21, 106, 20, 106, 20, 160, 19, 160, 19, 195, 18,
- 195, 18, 213, 17, 213, 17, 219, 16, 219, 16, 209, 15, 209, 15, 185, 14,
- 185, 14, 150, 13, 150, 13, 102, 12, 102, 12, 43, 11, 43, 11, 233, 9, 233,
- 9, 157, 8, 157, 8, 74, 7, 74, 7, 241, 5, 241, 5, 146, 4, 146, 4, 48, 3,
- 48, 3, 203, 1, 203, 1, 101, 0, 101, 0, 254, 254, 254, 254, 151, 253, 151,
- 253, 52, 252, 52, 252, 212, 250, 212, 250, 118, 249, 118, 249, 33, 248,
- 33, 248, 209, 246, 209, 246, 134, 245, 134, 245, 72, 244, 72, 244, 20,
- 243, 20, 243, 232, 241, 232, 241, 202, 240, 202, 240, 185, 239, 185, 239,
- 180, 238, 180, 238, 191, 237, 191, 237, 218, 236, 218, 236, 4, 236, 4,
- 236, 64, 235, 64, 235, 141, 234, 141, 234, 236, 233, 236, 233, 94, 233,
- 94, 233, 228, 232, 228, 232, 125, 232, 125, 232, 42, 232, 42, 232, 235,
- 231, 235, 231, 193, 231, 193, 231, 171, 231, 171, 231, 170, 231, 170, 231,
- 190, 231, 190, 231, 230, 231, 230, 231, 34, 232, 34, 232, 115, 232, 115,
- 232, 217, 232, 217, 232, 81, 233, 81, 233, 221, 233, 221, 233, 124, 234,
- 124, 234, 44, 235, 44, 235, 238, 235, 238, 235, 195, 236, 195, 236, 165,
- 237, 165, 237, 154, 238, 154, 238, 156, 239, 156, 239, 171, 240, 171, 240,
- 202, 241, 202, 241, 243, 242, 243, 242, 38, 244, 38, 244, 102, 245, 102,
- 245, 173, 246, 173, 246, 251, 247, 251, 247, 83, 249, 83, 249, 174, 250,
- 174, 250, 13, 252, 13, 252, 115, 253, 115, 253, 216, 254, 216, 254, 62, 0,
- 62, 0, 166, 1, 166, 1, 11, 3, 11, 3, 109, 4, 109, 4, 204, 5, 204, 5, 38,
- 7, 38, 7, 122, 8, 122, 8, 199, 9, 199, 9, 11, 11, 11, 11, 71, 12, 71, 12,
- 119, 13, 119, 13, 155, 14, 155, 14, 181, 15, 181, 15, 193, 16, 193, 16,
- 189, 17, 189, 17, 172, 18, 172, 18, 138, 19, 138, 19, 87, 20,
- ]),
- );
});
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 56a8ffe2d3..1028dc12f5 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1307,6 +1307,9 @@ importers:
prettier-plugin-organize-imports:
specifier: 3.2.4
+ pureimage:
+ specifier: ^0.1.6
+ version: 0.1.6
ts-node:
specifier: ^10.8.0
version: 10.8.0(@types/[email protected])([email protected])
@@ -16182,6 +16185,10 @@ packages:
'@sideway/pinpoint': 2.0.0
dev: false
+ resolution: {integrity: sha512-9IXdWudL61npZjvLuVe/ktHiA41iE8qFyLB+4VDTblEsWBzeg8WQTlktdUK4CdncUqtUgUg0bbOmTE2bKBKaBQ==}
+ dev: true
+
resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==}
engines: {node: '>= 0.8'}
@@ -17988,6 +17995,11 @@ packages:
hasBin: true
dev: false
+ resolution: {integrity: sha512-GthxucX/6aftfLdeU5Ho7o7zmQcC8uVtqdcelVq12X++ndxwBZG8Xb5rFEKT7nEcWDD2P1x+TNuJ70jtj1Mbpw==}
+ hasBin: true
+ dev: true
+
resolution: {integrity: sha512-d2JE9RP/6uagpQAVtJoF0pJJA/fgai89Cc50Yp0EJHk+eLp6QQ7gBoblsnubRULNY132I0J1QKMJ+JTbMqz4sw==}
engines: {node: '>= 8.0.0'}
@@ -18331,6 +18343,11 @@ packages:
url-polyfill: 1.1.12
dev: false
+ resolution: {integrity: sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==}
+ engines: {node: '>=4.0.0'}
+ dev: true
+
resolution: {integrity: sha512-jq4t3PJUpVRcveC53nnbEX35VyQI05x3tniwp26WFdm1dwaNUBHAi5awa/roBlwQxx1uRhwNSYeAi/aMbfiJCQ==}
engines: {node: '>=10'}
@@ -19429,6 +19446,14 @@ packages:
resolution: {integrity: sha512-QFADYnsVoBMw1srW7OVKEYjG+MbIa49s54w1MA1EDY6r2r/sTcKKYqRX1f4GYvnXP7eN/Pe9HFcX+hwzmrXRHA==}
dev: false
+ resolution: {integrity: sha512-t74leLaXyD3VGmMbcFZNWZoHqPQNX805gHYNBCrNEVRjUkDfdlopLJnDJI9QYdhWXwtNiD02coq+NB7+CryAwg==}
+ dependencies:
+ jpeg-js: 0.3.7
+ opentype.js: 0.4.11
+ pngjs: 3.4.0
+ dev: true
+
resolution: {integrity: sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==}
engines: {node: '>=0.6'}