thumbnail

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2017 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SizeSmall = ThumbDimension{
		MaxWidth:  320,
		MaxHeight: 240,
	}

	SizeMedium = ThumbDimension{
		MaxWidth:  640,
		MaxHeight: 480,
	}

	SizeLarge = ThumbDimension{
		MaxWidth:  1024,
		MaxHeight: 768,
	}
)

Functions

This section is empty.

Types

type ConversionService

type ConversionService struct {
	// contains filtered or unexported fields
}

func NewConversionService

func NewConversionService(logger logger.Logger, repository dataaccess.Repository, thumbnailIndex *Index) *ConversionService

type Index

type Index struct {
	Thumbs map[string]Thumbs `json:"thumbs"`
	// contains filtered or unexported fields
}

func EmptyIndex

func EmptyIndex() *Index

func NewIndex

func NewIndex(logger logger.Logger, indexFilePath, thumbnailFolder string) *Index

func (*Index) GetThumbnailFilepath

func (i *Index) GetThumbnailFilepath(thumb Thumb) string

func (*Index) GetThumbnailFolder

func (i *Index) GetThumbnailFolder() string

func (*Index) GetThumbs

func (i *Index) GetThumbs(thumbnailRoute string) (thumbs Thumbs, exists bool)

func (*Index) SetThumbs

func (i *Index) SetThumbs(thumbnailRoute string, thumbs Thumbs)

type Thumb

type Thumb struct {
	Route      string         `json:"route"`
	Path       string         `json:"path"`
	Dimensions ThumbDimension `json:"dimensions"`
}

func (Thumb) String

func (t Thumb) String() string

func (Thumb) ThumbRoute

func (t Thumb) ThumbRoute() route.Route

type ThumbDimension

type ThumbDimension struct {
	MaxWidth  uint `json:"maxWidth"`
	MaxHeight uint `json:"maxHeight"`
}

func GetThumbnailDimensionsFromRoute

func GetThumbnailDimensionsFromRoute(routeWithDimensions route.Route) (baseRoute route.Route, dimensions ThumbDimension)

func (ThumbDimension) String

func (t ThumbDimension) String() string

type Thumbs

type Thumbs map[string]Thumb

func (Thumbs) GetThumbBySize

func (thumbs Thumbs) GetThumbBySize(dimensions ThumbDimension) (Thumb, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL