do not fallback

This commit is contained in:
Celogeek 2023-07-04 15:45:11 +02:00
parent a3c9667d63
commit 095200a99c
Signed by: celogeek
SSH Key Fingerprint: SHA256:njNJLzoLQdbV9PC6ehcruRb0QnEgxABoCYZ+0+aUIYc

View File

@ -3,7 +3,6 @@
package epubimageprocessor
import (
"fmt"
"image"
_ "image/jpeg"
_ "image/png"
@ -20,10 +19,6 @@ func DecodeImage(name string, f io.ReadCloser) (img image.Image, err error) {
switch strings.ToLower(filepath.Ext(name)) {
case ".jpeg", ".jpg":
img, err = turbojpeg.Decode(f, &turbojpeg.DecoderOptions{})
if err != nil {
fmt.Println(err)
img, _, err = image.Decode(f)
}
default:
img, _, err = image.Decode(f)
}