fix(auto-thumbnail): [PKG-AUTO-THUMB-07] release terminal canvas storage

This commit is contained in:
Harvey Zhao committed 2026-09-14 03:48:00 +08:00
1 parent e93d3cbb67
commit 7be628a983
19 files changed
+4544 -15

No files matched your search

@@ -27,10 +27,20 @@ export default function extract(job: ExtractionJob, config: ExtractionConfig) {
video.style.width = `${videoWidth}px`
video.style.height = `${videoHeight}px`
const canvas = document.createElement('canvas')
job.own(() => {
canvas.height = 0
})
job.own(() => {
canvas.width = 0
})
if (!job.active())
return
canvas.width = canvasWidth
if (!job.active())
return
canvas.height = canvasHeight
if (!job.active())
return
const ctx = canvas.getContext('2d')
if (!ctx)
throw new Error('Auto-thumbnail canvas context is unavailable')