mirror of https://github.com/chaitin/PandaWiki.git
17 lines
327 B
Go
17 lines
327 B
Go
package utils
|
|
|
|
import (
|
|
"path/filepath"
|
|
"slices"
|
|
"strings"
|
|
)
|
|
|
|
func IsImageFile(filename string) bool {
|
|
ext := strings.ToLower(filepath.Ext(filename))
|
|
supportedImageExts := []string{
|
|
".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".ico", ".tiff", ".tif",
|
|
}
|
|
|
|
return slices.Contains(supportedImageExts, ext)
|
|
}
|