blob: 20c94d819df8630c7182a6747389118a3d359839 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package scanner
import (
"path/filepath"
"strings"
)
// supportedExtensions contains every image extension recognised
// by the scanner.
var supportedExtensions = map[string]struct{}{
".jpg": {},
".jpeg": {},
".png": {},
".gif": {},
".webp": {},
}
func isImage(path string) bool {
ext := strings.ToLower(filepath.Ext(path))
_, ok := supportedExtensions[ext]
return ok
}
|