feat(gif-worker): increase amount of web workers based on hardwareconcurrecy

(cherry picked from commit 63fd87612ea5a9e158762d6e68c401c4331d2803)
This commit is contained in:
Marc Diaz
2026-03-14 17:21:04 +11:00
committed by webadderall
parent 04a648daea
commit 309da98b2a
+3 -1
View File
@@ -124,9 +124,11 @@ export class GifExporter {
// Initialize GIF encoder
// Loop: 0 = infinite loop, 1 = play once (no loop)
const repeat = this.config.loop ? 0 : 1;
const cores = navigator.hardwareConcurrency || 4;
const WORKER_COUNT = Math.max(1, Math.min(8, cores - 1));
this.gif = new GIF({
workers: 4,
workers: WORKER_COUNT,
quality: 10,
width: this.config.width,
height: this.config.height,