Skip to content

Commit

Permalink
fix: decode of disposal 3
Browse files Browse the repository at this point in the history
  • Loading branch information
qq15725 committed Oct 23, 2023
1 parent 1548ba3 commit b7c5c70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/decode-frames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function decodeFrames(source: BufferSource, options?: DecodeFramesOptions

let pixels = new Uint8ClampedArray(globalWidth * globalHeight * 4)
let previousFrame: Frame | undefined
let previousPixels: Uint8ClampedArray | undefined
let previousPixels = pixels.slice()

return frames.map(frame => {
const {
Expand Down Expand Up @@ -135,7 +135,7 @@ export function decodeFrames(source: BufferSource, options?: DecodeFramesOptions
}
}

if (hasDisposal3 && (!previousPixels || disposal === 0 || disposal === 1)) {
if (hasDisposal3 && (disposal === 0 || disposal === 1)) {
previousPixels = pixels.slice()
}

Expand Down

1 comment on commit b7c5c70

@vercel
Copy link

@vercel vercel bot commented on b7c5c70 Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

modern-gif – ./

modern-gif.vercel.app
modern-gif-git-main-qq15725.vercel.app
modern-gif-qq15725.vercel.app

Please sign in to comment.