Documentation
¶
Index ¶
- Variables
- func GenerateThumbnail(media []*Media, dir, format string) ([]byte, error)
- func GenerateThumbnails(uploader Uploader, media []*Media, dir string, format string, force bool) ([]string, error)
- func ProcessDirectory(dir string, up Uploader, force bool) ([]string, error)
- func SaveThumbsFile(path string, media []*Media) error
- func ScanDirectory(dir string) ([]string, error)
- type ByThumbHeightDesc
- type Media
- type MediaContainer
- type Uploader
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrThumbYamlNotFound = fmt.Errorf(".thumbs.yml not found")
Functions ¶
func GenerateThumbnails ¶
func ProcessDirectory ¶
func SaveThumbsFile ¶
func ScanDirectory ¶
Types ¶
type ByThumbHeightDesc ¶
type ByThumbHeightDesc []MediaContainer
func (ByThumbHeightDesc) Len ¶
func (a ByThumbHeightDesc) Len() int
func (ByThumbHeightDesc) Less ¶
func (a ByThumbHeightDesc) Less(i, j int) bool
func (ByThumbHeightDesc) Swap ¶
func (a ByThumbHeightDesc) Swap(i, j int)
type Media ¶
type Media struct { Path string Width int `yaml:"width,omitempty"` Height int `yaml:"height,omitempty"` ThumbPath string `yaml:"thumb,omitempty"` ThumbXOffset int `yaml:"thumb_x,omitempty"` ThumbYOffset int `yaml:"thumb_y,omitempty"` ThumbWidth int `yaml:"thumb_width,omitempty"` ThumbHeight int `yaml:"thumb_height,omitempty"` ThumbTotalWidth int `yaml:"thumb_total_width,omitempty"` ThumbTotalHeight int `yaml:"thumb_total_height,omitempty"` Blurhash string `yaml:"blurhash,omitempty"` BlurhashImageBase64 string `yaml:"blurhash_image_base64,omitempty"` // contains filtered or unexported fields }
Media struct for items in .thumbs.yml file.
func LoadThumbsFile ¶
type MediaContainer ¶
type MediaContainer struct {
Media *Media
}
MediaContainer is a wrapper for Photo struct, used for sorting, so that references are not swapped and still can be modified.
Click to show internal directories.
Click to hide internal directories.