mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-18 03:36:33 -07:00
fix(resize): code format issue
This commit is contained in:
parent
d2a6c2d64d
commit
d31288c3c8
3 changed files with 6 additions and 6 deletions
|
|
@ -9,8 +9,8 @@ import (
|
||||||
// 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) {
|
||||||
// Required in order to prevent premature garbage collection. See:
|
// Required in order to prevent premature garbage collection. See:
|
||||||
// https://github.com/h2non/bimg/pull/162
|
// https://github.com/h2non/bimg/pull/162
|
||||||
defer runtime.KeepAlive(buf)
|
defer runtime.KeepAlive(buf)
|
||||||
return resizer(buf, o)
|
return resizer(buf, o)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,5 +6,5 @@ package bimg
|
||||||
// with the passed options.
|
// with the passed options.
|
||||||
// Used as proxy to resizer() only in Go <= 1.6 versions
|
// Used as proxy to resizer() only in Go <= 1.6 versions
|
||||||
func Resize(buf []byte, o Options) ([]byte, error) {
|
func Resize(buf []byte, o Options) ([]byte, error) {
|
||||||
return resizer(buf, o)
|
return resizer(buf, o)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ func TestDeterminateImageType(t *testing.T) {
|
||||||
if VipsIsTypeSupported(file.expected) {
|
if VipsIsTypeSupported(file.expected) {
|
||||||
if DetermineImageType(buf) != file.expected {
|
if DetermineImageType(buf) != file.expected {
|
||||||
t.Fatalf("Image type is not valid: %s != %s", file.name, ImageTypes[file.expected])
|
t.Fatalf("Image type is not valid: %s != %s", file.name, ImageTypes[file.expected])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue