fix(library): optimize image scanning, fast raw preview extraction and lazy thumbnail loading

This commit is contained in:
2026-10-05 06:34:37 +07:00
parent 554e121e41
commit 91722861f2
12 changed files with 625 additions and 160 deletions
+10 -1
View File
@@ -102,7 +102,16 @@ function rasterSurface(w: number, h: number) {
let grContext: any = null;
function ensureGrContext(): any {
if (grContext) return grContext;
if (grContext) {
if (typeof grContext.isContextLost === 'function' && grContext.isContextLost()) {
try {
if (typeof grContext.delete === 'function') grContext.delete();
} catch {}
grContext = null;
} else {
return grContext;
}
}
if (typeof OffscreenCanvas === 'undefined') return null;
try {
grContext = CK.MakeWebGLContext(CK.GetWebGLContext(new OffscreenCanvas(8, 8)));