Documentation ¶
Overview ¶
Package images generate thumbnails and converts between image formats.
Index ¶
- Constants
- Variables
- func Duplicate(name, suffix string) (string, error)
- func Fix() error
- func Generate(name, id string, remove bool) error
- func Info(name string) (width, height int, format string, err error)
- func Move(src, dest string) error
- func NewExt(name, ext string) string
- func ToPng(src, dest string, width, height int) (string, error)
- func ToThumb(src, dest string, sizeSquared int) (string, error)
- func ToWebp(src, dest string, vendorTempDir bool) (string, error)
- func WebPCalc(width, height int) (w, h int)
- func Width(name string) (int, error)
Constants ¶
View Source
const (
WebpMaxSize int = 16383 // WebpMaxSize is the maximum pixel dimension of an webp image.
)
Variables ¶
View Source
var ( ErrFormat = errors.New("unsupported image format") ErrViper = errors.New("viper directory locations cannot be read") )
Functions ¶
func Move ¶
Move a file from the source location to the destination. This is used in situations where os.rename() fails due to multiple partitions.
func ToPng ¶
ToPng converts any supported format to a compressed PNG image. helpful: https://www.programming-books.io/essential/ go/images-png-jpeg-bmp-tiff-webp-vp8-gif-c84a45304ec3498081c67aa1ea0d9c49.
func ToWebp ¶
ToWebp converts any supported format to a WebP image using a 3rd party library. Input format can be either GIF, PNG, JPEG, TIFF, WebP or raw Y'CbCr samples.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.