MCPcopy Create free account
hub / github.com/gogs/gogs / IsImageFile

Function IsImageFile

internal/tool/file.go:18–20  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

16}
17
18func IsImageFile(data []byte) bool {
19 return strings.Contains(http.DetectContentType(data), "image/")
20}
21
22func IsPDFFile(data []byte) bool {
23 return strings.Contains(http.DetectContentType(data), "application/pdf")

Callers 4

UpdateAvatarSettingFunction · 0.92
serveDataFunction · 0.92
UpdateAvatarSettingFunction · 0.92
renderFileFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected