add .gif support (single frame)
This commit is contained in:
parent
b149b8e570
commit
f7c82a7488
@ -2,6 +2,7 @@ package thumbnail
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"image/gif"
|
||||
"image/jpeg"
|
||||
"image/png"
|
||||
"os"
|
||||
@ -76,6 +77,14 @@ func (this *Thumbnailer) RenderFile_NoCache(absPath string) ([]byte, error) {
|
||||
|
||||
return this.RenderScaledImage(src)
|
||||
|
||||
case ".gif":
|
||||
src, err := gif.Decode(fh)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return this.RenderScaledImage(src)
|
||||
|
||||
case ".avi", ".mkv", ".mp4", ".ogm", ".wmv":
|
||||
return this.RenderScaledFfmpeg(absPath)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user