Files
opencloud/services/thumbnails/pkg/preprocessor/preprocessor_vips.go
T
Dominik Schmidt 75893c19ee refactor(thumbnails): thread context.Context through the preprocessor Convert interface
The Tika preview extractor does a network call; it was using context.Background().
Pass the request context from the gRPC handler through Convert so the unpack call
respects cancellation and deadlines. Non-I/O decoders ignore the context.
2026-08-19 18:45:11 +02:00

22 lines
353 B
Go

//go:build enable_vips
package preprocessor
import (
"context"
"io"
"github.com/davidbyttow/govips/v2/vips"
)
func init() {
vips.LoggingSettings(nil, vips.LogLevelError)
}
type ImageDecoder struct{}
func (v ImageDecoder) Convert(_ context.Context, r io.Reader) (interface{}, error) {
img, err := vips.NewImageFromReader(r)
return img, err
}