mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: some ui
This commit is contained in:
1 parent
43e1d53d39
commit
476d8e804a
5 files changed
+141
-6
No files matched your search
@@ -0,0 +1,9 @@
|
||||
import sharp from 'sharp';
|
||||
import { tankIcon } from './tankIcon';
|
||||
|
||||
export async function tankIconPng(id: number) {
|
||||
const imageResponse = await fetch(tankIcon(id));
|
||||
const imageBufferWEBP = await imageResponse.arrayBuffer();
|
||||
const imageBufferPNG = await sharp(imageBufferWEBP).png().toBuffer();
|
||||
return `data:image/png;base64,${imageBufferPNG.toString('base64')}`;
|
||||
}
|
||||
Reference in new issue
Block a user