davidbyttow / govips

A lightning fast image processing and resizing library for Go
MIT License
1.23k stars 196 forks source link

govips cannot be stopped and restarted #397

Closed DmitryPor closed 5 months ago

DmitryPor commented 7 months ago

I'm trying to run an example: https://github.com/davidbyttow/govips/blob/master/examples/jpeg/example_mozjpeg_image.go When the function is executed for the first time, it saves the jpg, but when I call the function again I get the error:

govips cannot be stopped and restarted /root/go/pkg/mod/github.com/davidbyttow/govips/v2@v2.13.0/vips/govips.go:61 (0xa9c1ac) Startup: panic("govips cannot be stopped and restarted")

I'm new to golang, please help

tonimelisma commented 5 months ago

Hey @DmitryPor. I'm really sorry but we can only help with govips related bugs or other issues here, not with general golang teaching support. Indeed, govips cannot be stopped and restarted. You should start/initiatlize it once in the beginning of your program.