Initial favicon add
This commit is contained in:
parent
6445be87a9
commit
bc89f5b819
8 changed files with 755 additions and 21 deletions
|
@ -19,6 +19,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/chai2010/webp"
|
||||
"github.com/fyne-io/image/ico"
|
||||
"golang.org/x/image/bmp"
|
||||
"golang.org/x/image/tiff"
|
||||
)
|
||||
|
@ -139,6 +140,8 @@ func cacheImage(imageURL, imageID string, isThumbnail bool) (string, bool, error
|
|||
// Decode the image based on the content type
|
||||
var img image.Image
|
||||
switch contentType {
|
||||
case "image/x-icon", "image/vnd.microsoft.icon":
|
||||
img, err = ico.Decode(bytes.NewReader(data))
|
||||
case "image/jpeg":
|
||||
img, err = jpeg.Decode(bytes.NewReader(data))
|
||||
case "image/png":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue