support tiff

This commit is contained in:
Celogeek 2024-05-01 12:43:45 +02:00
parent 5e5a07c930
commit 2c372594cc
Signed by: celogeek
SSH Key Fingerprint: SHA256:DEDfxIK2nUWXbslbRkww3zsauDjhWHlTXar+ak4lDJ4
2 changed files with 3 additions and 2 deletions

View File

@ -77,7 +77,7 @@ $ go install github.com/celogeek/go-comic-converter/v2@v2.6.9
The supported image files are jpeg and png from the sources. The supported image files are jpeg and png from the sources.
The extensions can be: `jpg`, `jpeg`, `png`, `webp`. The extensions can be: `jpg`, `jpeg`, `png`, `webp`, `tiff`.
The case for extensions doesn't matter. The case for extensions doesn't matter.

View File

@ -18,6 +18,7 @@ import (
"sync" "sync"
"golang.org/x/image/font/gofont/gomonobold" "golang.org/x/image/font/gofont/gomonobold"
_ "golang.org/x/image/tiff"
_ "golang.org/x/image/webp" _ "golang.org/x/image/webp"
"github.com/fogleman/gg" "github.com/fogleman/gg"
@ -43,7 +44,7 @@ var errNoImagesFound = errors.New("no images found")
// only accept jpg, png and webp as source file // only accept jpg, png and webp as source file
func (e *EPUBImageProcessor) isSupportedImage(path string) bool { func (e *EPUBImageProcessor) isSupportedImage(path string) bool {
switch strings.ToLower(filepath.Ext(path)) { switch strings.ToLower(filepath.Ext(path)) {
case ".jpg", ".jpeg", ".png", ".webp": case ".jpg", ".jpeg", ".png", ".webp", ".tiff":
{ {
return true return true
} }