switch image interpolation to CatmullRom
This commit is contained in:
committed by
Umputun
parent
5ecea4f80c
commit
dcab5a1622
@@ -70,7 +70,7 @@ func TestFsStore_SaveWithResize(t *testing.T) {
|
||||
t.Log(img)
|
||||
data, err := ioutil.ReadFile(img)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, 1142, len(data))
|
||||
assert.Equal(t, 1135, len(data))
|
||||
}
|
||||
|
||||
func TestFsStore_SaveWithResizeJpeg(t *testing.T) {
|
||||
@@ -91,7 +91,7 @@ func TestFsStore_SaveWithResizeJpeg(t *testing.T) {
|
||||
t.Log(img)
|
||||
data, err := ioutil.ReadFile(img)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, 10786, len(data))
|
||||
assert.Equal(t, 10918, len(data))
|
||||
}
|
||||
|
||||
func TestFsStore_SaveNoResizeJpeg(t *testing.T) {
|
||||
|
||||
@@ -161,7 +161,7 @@ func resize(data []byte, limitW, limitH int) []byte {
|
||||
|
||||
newW, newH := getProportionalSizes(w, h, limitW, limitH)
|
||||
m := image.NewRGBA(image.Rect(0, 0, newW, newH))
|
||||
draw.BiLinear.Scale(m, m.Bounds(), src, src.Bounds(), draw.Src, nil)
|
||||
draw.CatmullRom.Scale(m, m.Bounds(), src, src.Bounds(), draw.Src, nil)
|
||||
|
||||
var out bytes.Buffer
|
||||
if err = png.Encode(&out, m); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user