Switch to govips for native CGO image processing
- Replace gen2brain/avif, gen2brain/webp, disintegration/imaging with govips - govips uses libvips via CGO for fast native image processing - Add libheif-dev to Dockerfile for AVIF support - Add docker-test Makefile target for running tests in Docker - Update processor.go to use vips API for decode, resize, encode - Add TestMain to initialize/shutdown vips in tests - Remove WASM-based libraries (gen2brain) in favor of native codecs Performance improvement: AVIF encoding now uses native libheif instead of WASM, significantly reducing encoding time for large images.
This commit is contained in:
@@ -10,8 +10,17 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/davidbyttow/govips/v2/vips"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
vips.Startup(nil)
|
||||
code := m.Run()
|
||||
vips.Shutdown()
|
||||
os.Exit(code)
|
||||
}
|
||||
|
||||
// createTestJPEG creates a simple test JPEG image.
|
||||
func createTestJPEG(t *testing.T, width, height int) []byte {
|
||||
t.Helper()
|
||||
|
||||
Reference in New Issue
Block a user