mirror of
https://github.com/woodchen-ink/webp_server_go.git
synced 2025-07-18 13:42:02 +08:00
Should return original image when convert failed (#209)
This commit is contained in:
parent
9138e3d67a
commit
156fab9b6b
@ -143,6 +143,7 @@ func avifEncoder(p1, p2 string, quality int, extraParams ExtraParams) error {
|
|||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnf("Can't encode source image: %v to AVIF", err)
|
log.Warnf("Can't encode source image: %v to AVIF", err)
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := os.WriteFile(p2, buf, 0600); err != nil {
|
if err := os.WriteFile(p2, buf, 0600); err != nil {
|
||||||
@ -196,6 +197,7 @@ func webpEncoder(p1, p2 string, quality int, extraParams ExtraParams) error {
|
|||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnf("Can't encode source image: %v to WebP", err)
|
log.Warnf("Can't encode source image: %v to WebP", err)
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := os.WriteFile(p2, buf, 0600); err != nil {
|
if err := os.WriteFile(p2, buf, 0600); err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user