17 lines
278 B
Go
17 lines
278 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", ".webp",
|
|
}
|
|
|
|
return slices.Contains(supportedImageExts, ext)
|
|
}
|