mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-10 10:00:46 +09:00
GO-230 Fix lint 2
This commit is contained in:
parent
66d41bf5e2
commit
1f53e25eef
2 changed files with 12 additions and 11 deletions
|
@ -12,11 +12,13 @@ import (
|
|||
"io"
|
||||
"strconv"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/mill/ico"
|
||||
"github.com/chai2010/webp"
|
||||
"github.com/disintegration/imaging"
|
||||
"github.com/dsoprea/go-exif/v3"
|
||||
jpegstructure "github.com/dsoprea/go-jpeg-image-structure/v2"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/mill/ico"
|
||||
|
||||
// Import for image.DecodeConfig to support .webp format
|
||||
_ "golang.org/x/image/webp"
|
||||
)
|
||||
|
@ -183,17 +185,15 @@ func (m *ImageResize) Mill(r io.ReadSeeker, name string) (*Result, error) {
|
|||
|
||||
buff := &bytes.Buffer{}
|
||||
if format == JPEG {
|
||||
if err = jpeg.Encode(buff, resized, &jpeg.Options{Quality: quality}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = jpeg.Encode(buff, resized, &jpeg.Options{Quality: quality})
|
||||
} else if format == WEBP {
|
||||
if err = webp.Encode(buff, resized, &webp.Options{Quality: float32(quality)}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = webp.Encode(buff, resized, &webp.Options{Quality: float32(quality)})
|
||||
} else {
|
||||
if err = png.Encode(buff, resized); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = png.Encode(buff, resized)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &Result{
|
||||
|
|
|
@ -10,11 +10,12 @@ import (
|
|||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/mill/testdata"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
exif2 "github.com/dsoprea/go-exif/v3"
|
||||
"github.com/rwcarlsen/goexif/exif"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/mill/testdata"
|
||||
)
|
||||
|
||||
var errFailedToFindExifMarker = fmt.Errorf("exif: failed to find exif intro marker")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue