Documentation ¶
Overview ¶
Package thumbnail automatically generates thumbnails for a variety of common image formats and saves them to a user-configurable path.
Index ¶
- type Namer
- type Style
- type Thumbnail
- func (*Thumbnail) Initialize(context *goldsmith.Context) error
- func (*Thumbnail) Name() string
- func (self *Thumbnail) Namer(namer Namer) *Thumbnail
- func (self *Thumbnail) Process(context *goldsmith.Context, inputFile *goldsmith.File) error
- func (self *Thumbnail) Size(dims int) *Thumbnail
- func (self *Thumbnail) Style(style Style) *Thumbnail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Namer ¶
Namer callback function builds thumbnail file paths based on the original file path. An empty path can be returned if a thumbnail should not be generated for the current file.
type Thumbnail ¶
type Thumbnail struct {
// contains filtered or unexported fields
}
Thumbnail chainable context.
func (*Thumbnail) Namer ¶
Namer sets the callback used to build paths for thumbnail files. Default naming appends "-thumb" to the path and changes extension to PNG, for example "file.jpg" becomes "file-thumb.png".
func (*Thumbnail) Process ¶
func (*Thumbnail) Size ¶
Size sets the desired maximum pixel size of generated thumbnails (default: 128).
Click to show internal directories.
Click to hide internal directories.