Search code examples
flutterdartwebppub.dev

`WebP` tools is not found while running `pana` tool against dart package


While I was running pana to analyze a Dart package, an error stating that webpinfo, cwebp, and gif2webp were not found:

INFO       Running `webpinfo C:\Users\username\AppData\Local\Temp\pana_7ed394ff\.\doc/assets/animated_example.webp`...
'webpinfo' tool not found.INFO       Running `cwebp C:\Users\username\AppData\Local\Temp\pana_7ed394ff\.\doc/assets/animated_example.webp -o C:\Users\username\AppData\Local\Temp\365b6b14\gen\animated_example.webp`...
'cwebp' tool not found.INFO       Running `gif2webp C:\Users\username\AppData\Local\Temp\pana_7ed394ff\.\doc/assets/animated_example.webp -o C:\Users\username\AppData\Local\Temp\365b6b14\gen\animated_example.webp`...

Solution

  • All the mentioned tools are parts of WebP Library, according to the official website

    WebP is a modern image format that provides superior lossless and lossy compression for images on the web. Using WebP, webmasters and web developers can create smaller, richer images that make the web faster.

    To solve the error, download the latest version of the library from here, and install it according to the instructions on the same link.

    I have installed it on windows by just adding the path of the library until the bin/ folder to the Command Prompt (CMD) from the Environmental Variables settings on the windows as per this method.

    I think the same solution would work for macOS and Linux by exporting the path to the terminal.