[ref] apng typing

This commit is contained in:
kwaroran
2024-01-03 19:43:13 +09:00
parent b10c973efb
commit 81b75947cd

View File

@@ -4,6 +4,7 @@ import { v4 } from "uuid";
import { DataBase } from "./storage/database";
import { get } from "svelte/store";
import { isAPNG } from "./parser";
import { PngChunk } from "./pngChunk";
const inlayStorage = localforage.createInstance({
name: 'inlay',
@@ -100,7 +101,7 @@ export function supportsInlayImage(){
export async function reencodeImage(img:Uint8Array){
if(isAPNG(img)){
return img
return PngChunk.write(img, {}) as Promise<Buffer>
}
const canvas = document.createElement('canvas')
const imgObj = new Image()