MCPcopy
hub / github.com/h2non/bimg / Resize

Function Resize

resize.go:11–16  ·  view source on GitHub ↗

Resize is used to transform a given image as byte buffer with the passed options.

(buf []byte, o Options)

Source from the content-addressed store, hash-verified

9// Resize is used to transform a given image as byte buffer
10// with the passed options.
11func Resize(buf []byte, o Options) ([]byte, error) {
12 // Required in order to prevent premature garbage collection. See:
13 // https://github.com/h2non/bimg/pull/162
14 defer runtime.KeepAlive(buf)
15 return resizer(buf, o)
16}

Callers 15

ProcessMethod · 0.70
TestResizeFunction · 0.70
TestResizeVerticalImageFunction · 0.70
TestResizeCustomSizesFunction · 0.70
TestResizePrecisionFunction · 0.70
TestRotateFunction · 0.70
TestInvalidRotateDegreesFunction · 0.70
TestCorruptedImageFunction · 0.70
TestNoColorProfileFunction · 0.70
TestEmbedExtendColorFunction · 0.70
TestGaussianBlurFunction · 0.70

Calls 1

resizerFunction · 0.85

Tested by 15

TestResizeFunction · 0.56
TestResizeVerticalImageFunction · 0.56
TestResizeCustomSizesFunction · 0.56
TestResizePrecisionFunction · 0.56
TestRotateFunction · 0.56
TestInvalidRotateDegreesFunction · 0.56
TestCorruptedImageFunction · 0.56
TestNoColorProfileFunction · 0.56
TestEmbedExtendColorFunction · 0.56
TestGaussianBlurFunction · 0.56
TestSharpenFunction · 0.56