dendrite/vendor/gopkg.in/h2non/bimg.v1/resize.go
Benedikt Bongartz 9fd1cd7a37
Init go mod & update vendor
Signed-off-by: Benedikt Bongartz <benne@klimlive.de>
2019-05-18 03:37:24 +02:00

17 lines
362 B
Go

// +build go1.7
package bimg
import (
"runtime"
)
// Resize is used to transform a given image as byte buffer
// with the passed options.
func Resize(buf []byte, o Options) ([]byte, error) {
// Required in order to prevent premature garbage collection. See:
// https://github.com/h2non/bimg/pull/162
defer runtime.KeepAlive(buf)
return resizer(buf, o)
}