deno.land / x / lume@v2.1.4 / deps / sharp.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
export { default } from "npm:sharp@0.33.3";import sharp from "npm:sharp@0.33.3";import icoEndec from "npm:ico-endec@0.1.6";import { svg2png } from "./svg2png.ts";
export async function sharpsToIco(...images: sharp.Sharp[]) { const buffers = await Promise.all( images.map((image) => image.toFormat("png").toBuffer()), );
return icoEndec.encode(buffers.map((buffer) => buffer.buffer));}
export async function create( content: Uint8Array | string,): Promise<sharp.Sharp> { // It's a SVG if (typeof content === "string") { return sharp(await svg2png(content)); }
return sharp(content);}
lume

Version Info

Tagged at
a month ago