mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-04-20 22:17:23 -05:00
Import sharp when used
This commit is contained in:
parent
c966b7309e
commit
445093e58a
|
|
@ -1,7 +1,6 @@
|
|||
import * as fs from 'node:fs/promises';
|
||||
import * as path from 'node:path';
|
||||
import { Request } from 'express';
|
||||
import sharp from 'sharp';
|
||||
import { CoopRule, FestVoteState, FriendOnlineState, StageScheduleResult } from 'splatnet3-types/splatnet3';
|
||||
import { dir } from '../util/product.js';
|
||||
import createDebug from '../util/debug.js';
|
||||
|
|
@ -101,6 +100,8 @@ export async function renderUserEmbedImage(
|
|||
const start = Date.now();
|
||||
debug('generating image, format %s', PresenceEmbedFormat[format]);
|
||||
|
||||
const { default: sharp } = await import('sharp');
|
||||
|
||||
let image = sharp(Buffer.from(svg)).withMetadata({
|
||||
density: 72 * 2,
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user