Webp Image Processing

Hi folks does Hugo image processing support webp format?

Here’s my code

{{ with .Params.image }}
{{ $imageResource := ($.Site.GetPage "section" "uploads").Resources.GetMatch (strings.TrimPrefix "/uploads/" . ) }}
{{ $resized := $imageResource.Fill "100x100 Center" }}
   <a><img src="{{ $resized.RelPermalink }}"></a>
{{ end }}

the result is an error like this

```
Rebuild failed:

Failed to render pages: render of "home" failed: execute of template failed: template: index.html:21:7: executing "main" at <partial "content/homepage.html" .>: error calling partial: execute of template failed: template: partials/content/homepage.html:4:7: executing "partials/content/homepage.html" at <partial "component/section/homepage/series.html" .>: error calling partial: "E:\YUDY\WEB PROJECT\CLIENTS\Peci Iming\LIVE\Site\pi\themes\phi\layouts\partials\component\section\homepage\series.html:32:61": execute of template failed: template: partials/component/section/homepage/series.html:32:61: executing "partials/component/section/homepage/series.html" at <$imageResource.Fill>: can't evaluate field Fill in type resource.Resource
```

1 Like

That’s right. The documentation only speaks of JPEG.

1 Like

That what i thought, thanks for the information

I was searching for WebP support in Hugo, and found issue 5924, which, as of now, is in the milestone for Hugo 0.63/0.64.

3 Likes