Documentation
¶
Overview ¶
attachment thumbnailing
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCannotThumbanil = errors.New("cannot thumbnail file")
View Source
var ErrNoThumbnailer = errors.New("no thumbnailer found")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // width of thumbnails ThumbW int // height of thumbnails ThumbH int // only generate jpg thumbnails JpegOnly bool }
thumbnail configuration
type ExecThumbnailer ¶
type ExecThumbnailer struct { // path to executable Exec string // regular expression that checks for acceptable infiles Accept *regexp.Regexp // function to generate arguments to use with external program // inf and outf are the filenames of the input and output files respectively // if this is nil the command will be passed in 2 arguments, infile and outfile GenArgs func(inf, outf string) []string }
thumbnail by executing an external program
func (*ExecThumbnailer) CanThumbnail ¶
func (exe *ExecThumbnailer) CanThumbnail(infpath string) bool
func (*ExecThumbnailer) Generate ¶
func (exe *ExecThumbnailer) Generate(infpath, outfpath string) (err error)
type Thumbnailer ¶
type Thumbnailer interface { // generate thumbnail of attachment // // infpath: absolute filepath to attachment // // outfpath: absolute filepath to thumbnail // // return error if the thumbnailing fails Generate(infpath, outfpath string) error // can we generate a thumbnail for this file? CanThumbnail(infpath string) bool }
a generator of thumbnails
func FFMpegThumbnailer ¶
func FFMpegThumbnailer(ffmpegPath string, conf *Config) Thumbnailer
generate a thumbnailer that uses ffmpeg
func ImageMagickThumbnailer ¶
func ImageMagickThumbnailer(convertPath string, conf *Config) Thumbnailer
create an imagemagick thumbnailer
func MuxThumbnailers ¶
func MuxThumbnailers(th ...Thumbnailer) Thumbnailer
Click to show internal directories.
Click to hide internal directories.