mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-25 08:12:36 +02:00
do not fallback
This commit is contained in:
parent
a3c9667d63
commit
095200a99c
@ -3,7 +3,6 @@
|
|||||||
package epubimageprocessor
|
package epubimageprocessor
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"image"
|
"image"
|
||||||
_ "image/jpeg"
|
_ "image/jpeg"
|
||||||
_ "image/png"
|
_ "image/png"
|
||||||
@ -20,10 +19,6 @@ func DecodeImage(name string, f io.ReadCloser) (img image.Image, err error) {
|
|||||||
switch strings.ToLower(filepath.Ext(name)) {
|
switch strings.ToLower(filepath.Ext(name)) {
|
||||||
case ".jpeg", ".jpg":
|
case ".jpeg", ".jpg":
|
||||||
img, err = turbojpeg.Decode(f, &turbojpeg.DecoderOptions{})
|
img, err = turbojpeg.Decode(f, &turbojpeg.DecoderOptions{})
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
img, _, err = image.Decode(f)
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
img, _, err = image.Decode(f)
|
img, _, err = image.Decode(f)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user