Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resolution ¶
Resolution defines represents the width and height of a thumbnail.
func Parse ¶
func Parse(s string) (Resolution, error)
Parse parses a resolution string in the form <width>x<height> and returns a resolution instance.
func (Resolution) String ¶
func (r Resolution) String() string
String returns the resolution in the format:
<width>x<height>
type Resolutions ¶
type Resolutions []Resolution
Resolutions represents the available thumbnail resolutions.
func New ¶
func New(rStrs []string) (Resolutions, error)
New creates an instance of Resolutions from resolution strings.
func (Resolutions) ClosestMatch ¶
func (r Resolutions) ClosestMatch(width, height int) Resolution
ClosestMatch returns the resolution which is closest to the provided resolution. If there is no exact match the resolution will be the next higher one. If the given resolution is bigger than all available resolutions the biggest available one is used.
Click to show internal directories.
Click to hide internal directories.