Documentation ¶
Index ¶
- Constants
- func NormalizeSize(media, requested image.Rectangle) image.Rectangle
- func ParseSizeString(str string, actual image.Rectangle) (image.Rectangle, error)
- func SizeRequested(urlpath string, actual image.Rectangle) (image.Rectangle, error)
- func ThumbImage(filename string, img image.Image, size image.Rectangle) error
- func VideoEncode(filename string, size image.Rectangle, thumbDir string) error
- func VideoFrame(filename string) (image.Image, error)
- func VideoSize(filename string) (image.Rectangle, error)
- type Media
- type MediaSource
- func (ms *MediaSource) ByName(name string) (*Media, error)
- func (ms *MediaSource) HasThumb(m Media, size image.Rectangle) bool
- func (ms *MediaSource) ReceiveNewMedia(name string, r io.Reader) error
- func (ms *MediaSource) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (ms *MediaSource) Size(name string) (image.Rectangle, error)
- func (ms *MediaSource) Thumb(m Media, size image.Rectangle) (image.Rectangle, error)
- func (ms *MediaSource) ThumbFilename(m Media, size image.Rectangle) string
- func (ms *MediaSource) ThumbMax(m Media, maxDim int) (image.Rectangle, error)
- func (ms *MediaSource) ThumbPath(m Media, size image.Rectangle) string
- func (ms *MediaSource) Walk() ([]*Media, error)
- type Set
Constants ¶
View Source
const ( TypeImage = "image" TypeVideo = "video" )
Variables ¶
This section is empty.
Functions ¶
func ParseSizeString ¶
func SizeRequested ¶
Types ¶
type Media ¶
type MediaSource ¶
type MediaSource struct { StorageDir string ThumbDir string // contains filtered or unexported fields }
func (*MediaSource) ReceiveNewMedia ¶
func (ms *MediaSource) ReceiveNewMedia(name string, r io.Reader) error
func (*MediaSource) ServeHTTP ¶
func (ms *MediaSource) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*MediaSource) ThumbFilename ¶
func (ms *MediaSource) ThumbFilename(m Media, size image.Rectangle) string
func (*MediaSource) ThumbPath ¶
func (ms *MediaSource) ThumbPath(m Media, size image.Rectangle) string
func (*MediaSource) Walk ¶
func (ms *MediaSource) Walk() ([]*Media, error)
Click to show internal directories.
Click to hide internal directories.