From ea821d57e8d1c1734a5150d798734cc0b3dd1593 Mon Sep 17 00:00:00 2001 From: Yegor Pelykh Date: Fri, 12 Apr 2024 22:07:31 +0300 Subject: [PATCH] fix: Disable palette remapping for animated GIFs Current implementation has performance issues --- src/formats/gif-decoder.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/formats/gif-decoder.ts b/src/formats/gif-decoder.ts index 57990de..ad4bb16 100644 --- a/src/formats/gif-decoder.ts +++ b/src/formats/gif-decoder.ts @@ -718,6 +718,7 @@ export class GifDecoder implements Decoder { if (frame.disposal === 2) { nextImage.clear(colorMap.getColor(this._info.backgroundColor!.r)); } else if (frame.disposal !== 3) { + /* const nextBytes = nextImage.toUint8Array(); const lastBytes = lastImage.toUint8Array(); const lp = lastImage.palette!; @@ -733,6 +734,7 @@ export class GifDecoder implements Decoder { nextBytes[i] = nc; } } + */ } nextImage.frameDuration = image.frameDuration;