mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-15 18:35:54 -07:00
fix(resize): runtime.KeepAlive is only Go
This commit is contained in:
parent
98c931eb89
commit
bac8e42eae
1 changed files with 0 additions and 2 deletions
|
|
@ -9,14 +9,12 @@ import "C"
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"math"
|
"math"
|
||||||
"runtime"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Resize is used to transform a given image as byte buffer
|
// Resize is used to transform a given image as byte buffer
|
||||||
// with the passed options.
|
// with the passed options.
|
||||||
func Resize(buf []byte, o Options) ([]byte, error) {
|
func Resize(buf []byte, o Options) ([]byte, error) {
|
||||||
defer C.vips_thread_shutdown()
|
defer C.vips_thread_shutdown()
|
||||||
defer runtime.KeepAlive(buf)
|
|
||||||
|
|
||||||
image, imageType, err := loadImage(buf)
|
image, imageType, err := loadImage(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue