Skip to content

Commit 8cdf3a6

Browse files
committed
Decode
1 parent d59436c commit 8cdf3a6

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

common/hugo/hugo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ func GetDependencyList() []string {
310310

311311
// GetDependencyListNonGo returns a list of non-Go dependencies.
312312
func GetDependencyListNonGo() []string {
313-
deps := []string{formatDep("github.com/webmproject/libwebp", "v1.6.0")} // via WASM.}
313+
deps := []string{formatDep("github.com/webmproject/libwebp", "v1.6.0")} // via WASM. TODO(bep) get versions from the plugin setup.
314314

315315
if IsExtended {
316316
deps = append(

internal/warpc/warpc.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"encoding/json"
2222
"errors"
2323
"fmt"
24+
"image"
2425
"io"
2526
"os"
2627
"strings"
@@ -756,8 +757,8 @@ func AllDispatchers(opts Options) *Dispatchers {
756757
webp: &lazyDispatcher[WebpInput, WebpOutput]{opts: webOpts},
757758
}
758759

759-
// TODO1 better way to do this?
760-
// image.RegisterFormat("webp", "RIFF????WEBPVP8", dispatchers.DecodeWebp, dispatchers.DecodeWebpConfig)
760+
// TODO1 find a non-global way to do this.
761+
image.RegisterFormat("webp", "RIFF????WEBPVP8", dispatchers.DecodeWebp, dispatchers.DecodeWebpConfig)
761762

762763
return dispatchers
763764
}

internal/warpc/webp.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"io"
2222
"time"
2323

24-
webp "github.com/bep/webptemp"
2524
"github.com/gohugoio/hugo/common/hdebug"
2625
"github.com/gohugoio/hugo/common/hugio"
2726
)
@@ -68,10 +67,6 @@ func (d *Dispatchers) stopClock(what string, start time.Time) {
6867

6968
// Decode reads a WEBP image from r and returns it as an image.Image.
7069
func (d *Dispatchers) DecodeWebp(r io.Reader) (image.Image, error) {
71-
var enabled bool
72-
if !enabled {
73-
return webp.Decode(r)
74-
}
7570
dd, err := d.Webp()
7671
if err != nil {
7772
return nil, err

0 commit comments

Comments
 (0)