Missing changes

This commit is contained in:
2026-07-24 16:10:44 +02:00
parent 52bc694ffa
commit 65983ec6be
5 changed files with 77 additions and 6 deletions
+10
View File
@@ -7,12 +7,22 @@ import (
"image/jpeg"
_ "image/png"
"io"
"path/filepath"
"strings"
)
func init() {
thumbnailers = append(thumbnailers, &imageThumbnailer{})
}
// isImageFile reports whether name is a raster image we can thumbnail and thus
// embed on a page. Video files also carry thumbnails but are not embeddable, so
// this keys on the image thumbnailer's own extension set rather than
// hasThumbnail.
func isImageFile(name string) bool {
return (&imageThumbnailer{}).CanHandle(strings.ToLower(filepath.Ext(name)))
}
type imageThumbnailer struct{}
func (it *imageThumbnailer) CanHandle(ext string) bool {