add FiletypeSupported() function
This commit is contained in:
parent
f7c82a7488
commit
a778c530c2
@ -49,6 +49,15 @@ func (this *Thumbnailer) RenderFile(absPath string) ([]byte, error) {
|
|||||||
return thumb.([]byte), nil
|
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) {
|
func (this *Thumbnailer) RenderFile_NoCache(absPath string) ([]byte, error) {
|
||||||
|
|
||||||
fh, err := os.OpenFile(absPath, os.O_RDONLY, 0400)
|
fh, err := os.OpenFile(absPath, os.O_RDONLY, 0400)
|
||||||
|
Loading…
Reference in New Issue
Block a user