feat: add support for WebP images in Ollama's app

This commit is contained in:
Daniel Alejandro Coll Tejeda
2025-11-05 21:23:20 +01:00
parent 408c2f99d0
commit bddfa2100f
4 changed files with 116 additions and 3 deletions

View File

@@ -1705,7 +1705,7 @@ func getStringFromMap(m map[string]any, key, defaultValue string) string {
// isImageAttachment checks if a filename is an image file
func isImageAttachment(filename string) bool {
ext := strings.ToLower(filename)
return strings.HasSuffix(ext, ".png") || strings.HasSuffix(ext, ".jpg") || strings.HasSuffix(ext, ".jpeg")
return strings.HasSuffix(ext, ".png") || strings.HasSuffix(ext, ".jpg") || strings.HasSuffix(ext, ".jpeg") || strings.HasSuffix(ext, ".webp")
}
// ptr is a convenience function for &literal