add FiletypeSupported() function

This commit is contained in:
mappu 2016-12-05 19:47:24 +13:00
parent f7c82a7488
commit a778c530c2

View File

@ -49,6 +49,15 @@ func (this *Thumbnailer) RenderFile(absPath string) ([]byte, error) {
return thumb.([]byte), nil
}
func FiletypeSupported(ext string) bool {
switch strings.ToLower(ext) {
case ".jpg", ".jpeg", ".png", ".gif", ".avi", ".mkv", ".mp4", ".ogm", ".wmv":
return true
default:
return false
}
}
func (this *Thumbnailer) RenderFile_NoCache(absPath string) ([]byte, error) {
fh, err := os.OpenFile(absPath, os.O_RDONLY, 0400)