jekyll-webp
jekyll-webp copied to clipboard
Fails to convert GIFs
Steps to reproduce:
- Create a GIF in a directory currently being processed by the gem.
- Add
".gif"to the list of file formats. - Specify
."gif"as the gif extension. - Observe the following error:
Conversion for image someImage.gif failed, no webp version could be created for this image
Here's my config:
webp:
enabled: true
# The quality of the webp conversion 0 to 100 (where 100 is least lossy)
quality: 75
# List of directories containing images to optimize, nested directories will only be checked if `nested` is true
# By default the generator will search for a folder called `/img` under the site root and process all jpg, png and tiff image files found there.
img_dir: ["/assets/img/"]
# Whether to search in nested directories or not
nested: true
# add ".gif" to the format list to generate webp for animated gifs as well
formats: [".jpg", ".png", ".gif"]
# File extensions for animated gif files
gifs: [".gif"]
# Set to true to always regenerate existing webp files
regenerate: true
# Local path to the WebP utilities to use (relative or absolute)
# Omit or leave as nil to use the utilities shipped with the gem, override only to use your local install
webp_path: nil
All other file formats work.
Did you ever figure this out? I'm having the same issue.
@N-Upchurch Nope, I didn't
So, it looks like you have to use gif2webp to convert gifs, not cwebp. At least, when I download the binaries and test, the latter works whereas the former does not.
I've submitted a pull request to fix this as best as I can. It's most definitely not the best way to do it, but I'm not a Ruby dev haha. Only tested on Ubuntu. In the meantime, if anyone needs to use the gif -> webp functionality, they can manually edit their local copy of the gem using the updated files in my fork, and adding the gif2webp binaries.
Yeah, I just process images manually on my site and use gif2webp for animated GIFs
But I think the latest version of this plugin should be able to handle GIFs (haven't tested)