Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
qq15725 committed Jan 10, 2024
1 parent 44e5777 commit dfad646
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const output = await encode({
width: 200, height: 200,
frames: [
// CanvasImageSource | BufferSource | string
{ imageData: '/example1.png', delay: 100 },
{ imageData: '/example2.png', delay: 100 }
{ data: '/example1.png', delay: 100 },
{ data: '/example2.png', delay: 100 }
],
})

Expand Down Expand Up @@ -79,7 +79,7 @@ frames.forEach(frame => {
canvas.width = frame.width
canvas.height = frame.height
canvas.getContext('2d').putImageData(
new ImageData(frame.imageData, frame.width, frame.height),
new ImageData(frame.data, frame.width, frame.height),
0, 0,
)
document.body.append(canvas)
Expand All @@ -106,7 +106,7 @@ const gif = decode(buffer)
const frames = await decodeFrames(buffer, { workerUrl })
const output = await encode({
// workerUrl is optional
workerUrl, workerNumber: 2,
workerUrl,
width: gif.width, height: gif.height,
frames,
// lossy compression 2 - 255
Expand All @@ -129,8 +129,8 @@ window.open(URL.createObjectURL(blob))
width: 200, height: 200,
frames: [
// CanvasImageSource | BufferSource | string
{ imageData: '/example1.png', delay: 100 },
{ imageData: '/example2.png', delay: 100 }
{ data: '/example1.png', delay: 100 },
{ data: '/example2.png', delay: 100 }
],
}).then(output => {
const blob = new Blob([output], { type: 'image/gif' })
Expand Down

1 comment on commit dfad646

@vercel
Copy link

@vercel vercel bot commented on dfad646 Jan 10, 2024

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-qq15725.vercel.app
modern-gif.vercel.app
modern-gif-git-main-qq15725.vercel.app

Please sign in to comment.