mirror of
https://github.com/status-im/status-go.git
synced 2025-02-17 17:28:38 +00:00
21 lines
390 B
Go
21 lines
390 B
Go
package images
|
|
|
|
import (
|
|
"image"
|
|
|
|
"github.com/nfnt/resize"
|
|
"github.com/oliamb/cutter"
|
|
)
|
|
|
|
func ResizeSquare(size uint, img image.Image) image.Image {
|
|
return resize.Resize(size, 0, img, resize.Bilinear)
|
|
}
|
|
|
|
func CropSquare(img image.Image, size int, anchor image.Point) (image.Image, error) {
|
|
return cutter.Crop(img, cutter.Config{
|
|
Width: size,
|
|
Height: size,
|
|
Anchor: anchor,
|
|
})
|
|
}
|