puppeteer-lottie
puppeteer-lottie copied to clipboard
Output Specific Frame of Animation
- Adds
frame
option to output single specific frame.
await renderLottie({
path: 'fixtures/bodymovin.json',
output: 'preview.jpg',
frame: 12,
})
I'm sure there's some cleanup that can be done here to better integrate it into the architecture of this package, but as far as rough working draft that gets the job done, this works for me.
Fixes #40
After I opened this PR, I saw this other PR trying to do the same thing: https://github.com/transitive-bullshit/puppeteer-lottie/pull/44
I thought their solution looked more flexible since it can be used for video files, but after testing it out, it doesn't seem to work. At least I couldn't get a test to pass.