Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video frames from WEBP and GIF originals are stripped off #139

Closed
richardneililagan opened this issue Jan 19, 2022 · 2 comments
Closed

Video frames from WEBP and GIF originals are stripped off #139

richardneililagan opened this issue Jan 19, 2022 · 2 comments
Milestone

Comments

@richardneililagan
Copy link

When using a .webp or .gif file that has video / animation frames as an input to the plugin, the output files seem to have stripped those out, and all we're left with are still images.

In my case, my pipeline is something akin to this --- nothing special I think? :

const image = require('@11ty/eleventy-img')

// ...

const imagedata = await image(IMAGE_PATH, {
  widths: [624],
  outputDir: './_site/i/',
  urlPath: '/i/',
})

// `imagedata` is then parsed to the corresponding `picture > source + img` markup.
@AleksandrHovhannisyan
Copy link
Contributor

AleksandrHovhannisyan commented Jan 19, 2022

I ran into this issue myself and ended up removing animated GIFs from my site for that reason. Curious to see if there's a way to process them while retaining the frames. I know Google provides a gif2webp command-line utility (similar to cwebp) that can be used to convert animated GIFs to animated WebPs. As a temporary workaround, you might be able to process those manually and passthrough-copy them to a dedicated folder for GIFs. Not ideal, though.

@zachleat zachleat added this to the v1.1.0 milestone Feb 23, 2022
@zachleat
Copy link
Member

sharp added support in 0.30.0 which will ship with Eleventy Image v1.1.0.

Tested here

test("Animated gif", async t => {

You will need to pass in the animated prop to sharpOptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants