Documentation
¶
Overview ¶
Package thumbnailer contains a utility with which thumbnails can be generated from an image.
Index ¶
Constants ¶
View Source
const (
DefaultMaxSize = 300
)
Variables ¶
View Source
var (
ErrInvalidImage = errors.New("invalid image")
)
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(t *Thumbnailer)
func OutFormat ¶
func OutFormat(value OutputFormat) Option
OutFormat sets the output image format used by Create. By default, the format of the original image is used.
func Quality ¶
Quality sets the JPG quality used by Create. It has no effect if the output format is not JPG. By default, jpeg.DefaultQuality is used.
func Scaler ¶
Scaler sets the draw.Scaler used by Create. By default, the draw.ApproxBiLinear scaler is used.
type Thumbnailer ¶
type Thumbnailer struct {
// contains filtered or unexported fields
}
func New ¶
func New(options ...Option) Thumbnailer
New creates a new instance of Thumbnailer with which thumbnails can be generated.
func (Thumbnailer) Create ¶
func (t Thumbnailer) Create() ([]byte, error)
Create generates a thumbnail, returning the encoded thumbnail image or an error.
func (Thumbnailer) With ¶
func (t Thumbnailer) With(o Option) Thumbnailer
With applies an option to the Thumbnailer instance.
Click to show internal directories.
Click to hide internal directories.