mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 03:07:04 +02:00
feat: hero stat
This commit is contained in:
1 parent
9717f153cd
commit
ebb7618f2d
10 files changed
+238
-43
No files matched your search
@@ -2,7 +2,9 @@ import sharp from 'sharp';
|
||||
|
||||
const cache: Record<string, Buffer> = {};
|
||||
|
||||
export async function iconPng(url: string) {
|
||||
export async function webpToPng(url: string) {
|
||||
if (!url.endsWith('.webp')) return url;
|
||||
|
||||
if (!cache[url]) {
|
||||
const imageResponse = await fetch(url);
|
||||
const imageBufferWEBP = await imageResponse.arrayBuffer();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { iconPng } from './iconPng';
|
||||
import { webpToPng } from './iconPng';
|
||||
import { tankIcon } from './tankIcon';
|
||||
|
||||
export function tankIconPng(id: number) {
|
||||
return iconPng(tankIcon(id));
|
||||
return webpToPng(tankIcon(id));
|
||||
}
|
||||
Reference in new issue
Block a user