goldsmith-components: Index | Files

package thumbnail

import ""

Package thumbnail automatically generates thumbnails for a variety of common image formats and saves them to a user-configurable path.


Package Files


type Namer Uses

type Namer func(string, uint) string

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 Uses

type Thumbnail struct {
    // contains filtered or unexported fields

Thumbnail chainable context.

func New Uses

func New() *Thumbnail

New creates a new instance of the Thumbnail plugin.

func (*Thumbnail) Initialize Uses

func (*Thumbnail) Initialize(context *goldsmith.Context) (goldsmith.Filter, error)

func (*Thumbnail) Name Uses

func (*Thumbnail) Name() string

func (*Thumbnail) Namer Uses

func (plugin *Thumbnail) Namer(namer Namer) *Thumbnail

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 Uses

func (plugin *Thumbnail) Process(context *goldsmith.Context, inputFile *goldsmith.File) error

func (*Thumbnail) Size Uses

func (plugin *Thumbnail) Size(dims uint) *Thumbnail

Size sets the desired maximum pixel size of generated thumbnails (default: 128).

Package thumbnail imports 11 packages (graph). Updated 2019-04-08. Refresh now. Tools for package owners.