Don't generate thumbnails for webp (#2388)

* Don't generate thumbnails for animated webp
* Debug log when writing thumbnail to disk
This commit is contained in:
WithoutPants
2022-03-20 17:48:52 +11:00
committed by GitHub
parent f69bd8a94f
commit 6ceb9c73dd
7 changed files with 148 additions and 16 deletions

View File

@@ -3,6 +3,7 @@ package manager
import (
"context"
"database/sql"
"errors"
"path/filepath"
"time"
@@ -155,7 +156,10 @@ func (t *ScanTask) generateThumbnail(i *models.Image) {
data, err := encoder.GetThumbnail(i, models.DefaultGthumbWidth)
if err != nil {
logger.Errorf("error getting thumbnail for image %s: %s", i.Path, err.Error())
// don't log for animated images
if !errors.Is(err, image.ErrNotSupportedForThumbnail) {
logger.Errorf("error getting thumbnail for image %s: %s", i.Path, err.Error())
}
return
}