feat(thumbnails): optional libvips based thumbnail generation

Can be enabled by setting the 'enable_vips' tag on 'go build'
This commit is contained in:
Ralf Haferkamp
2024-10-14 17:46:30 +02:00
committed by Ralf Haferkamp
parent 358adc15dc
commit a9a5570050
58 changed files with 7324 additions and 0 deletions

View File

@@ -1,3 +1,5 @@
//go:build !enable_vips
package preprocessor
import (

View File

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