Skip to content

Commit

Permalink
feat: support webp format
Browse files Browse the repository at this point in the history
  • Loading branch information
xwjdsh committed Jun 7, 2024
1 parent 4292a6a commit 7a5fbfc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/images/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/disintegration/imaging"
"github.com/rs/zerolog/log"
"github.com/waynezhang/foto/internal/files"
_ "golang.org/x/image/webp"
)

type ImageSize struct {
Expand All @@ -20,7 +21,7 @@ type ImageSize struct {

func IsPhotoSupported(path string) bool {
lowerExt := strings.ToLower(filepath.Ext(path))
return lowerExt == ".jpeg" || lowerExt == ".jpg"
return lowerExt == ".jpeg" || lowerExt == ".jpg" || lowerExt == ".webp"
}

func GetPhotoSize(path string) (*ImageSize, error) {
Expand Down

0 comments on commit 7a5fbfc

Please sign in to comment.