Git Product home page Git Product logo

jekyll-webp's People

Contributors

emmmile avatar jetroid avatar kball avatar sverrirs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jekyll-webp's Issues

nested: false Bug

If if nested: false set to true, it still does not travel directories nested within the image folder.

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/images"]

  # 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: [".jpeg", ".jpg", ".png", ".tiff"]

  # 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

  # List of files or directories to exclude
  # e.g. custom or hand generated webp conversion files
  exclude: []

  # append '.webp' to filename after original extension rather than replacing it.
  # Default transforms `image.png` to `image.webp`, while changing to true transforms `image.png` to `image.png.webp`
  append_ext: true
############################################################

Lossless option?

I see quality can be controlled up to 100 (least lossy) but webp has two different "modes" and 100% quality is not the same as lossless and in fact for areas where a transparent png is the best non-webp format, usually webp lossless is superior (file size and quality) to webp lossy 100%.

Is there a way to enable lossless?

It might also be good to be able to configure webp settings per file type - so I can have different settings for my pngs (graphics) than for my jpegs (photos) as it is likely there is not a single set of rules that would compress both types well.

WebP: Conversion failed

I've been trying to use jekyll-webp to automatically generate webp versions of my images for my jekyll blog, running on GitHub pages.

Unfortunately, the GitHub action shows a convertion error for every single file:

WebP: Conversion for image /github/workspace/images/myimage.png failed, no webp version could be created for this image

Seems like this is related to some other open issues (eg, #15) and jekyll-webp just isn't usable in GitHub actions.

Too bad - I'll have to convert my images manually then...

append_ext: true doesn't work

With append_ext: true, it is expected that images will be generated in the format image.png.webp. However, that is not the case

Running linux-x64-cwebp binary fails in GitHub Actions

I'm using this GitHub action https://github.com/helaili/jekyll-action which enables third-party gems support on GitHub Pages. I can confirm that other third-party gems that I use work fine but this one doesn't. It fails with following error:

WebP: Change to source image file /github/workspace/images/1.jpg detected, regenerating WebP

 WebP: Conversion for image /github/workspace/images/1.jpg failed, no webp version could be created for this image

Using some debug logging statements, I noticed 'Permission denied' errors, but sudo doesn't work either.
From the GitHub Actions docs:

The Linux and macOS virtual machines both run using passwordless sudo. When you need to execute commands or install tools that require more privileges than the current user, you can use sudo without needing to provide a password.

Any suggestions on how to proceed?

BTW I also had to add require 'date' to the jekyll-webp.gemspec file because it wasn't imported automatically.
Moreover, the gem that is installed via gem install jekyll-webp doesn't seem to work (even locally) which is why I'm pulling the GitHub version of this gem directly.

Several questions about WebP generation

Hello!

Please, let me ask several questions about your plugin:

  1. All WebP images generated by the plugin will be stored in the same folder, where is the main .jpg image?

  2. If I optimize all my .jpg images using Photoshop. Should I off image optimization (serve) function of the plugin?

And all generated WebP images will be less size, that original .jpg images, right? Because WebP newer and should be less size. than .jpg.

Sorry sir for my bad English. Hello from Kazakhstan! And thank you for your work!

Plugin doesn't appear to be working with Jekyll 3.8.5 on Windows 10

Link to my Gemfile. To reproduce, clone my site and use img_dir: ["/assets/img/posts/"] and nested: true.

For quite a while now, I've been manually converting my images to WebP using the cwebp CLI tool, so I was pretty excited when I found this gem!

Unfortunately, it doesn't appear to work... I see the output saying that it's detected changes to my images and is regenerating their corresponding webp formats:

WebP: Generator Complete: 107 file(s) generated

But... it doesn't actually generate any new files. Or if it does, it's dumping them somewhere else. Git doesn't report any new files, so ๐Ÿคทโ€โ™‚

I'm on Windows 10 and using WSL, if that makes any difference.

Fails to convert GIFs

Steps to reproduce:

  1. Create a GIF in a directory currently being processed by the gem.
  2. Add ".gif" to the list of file formats.
  3. Specify ."gif" as the gif extension.
  4. 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.