Fix image thumbnail generation (#2524)

* Better logging for thumbnail generation errors
* Reduce verbosity for thumbnail generation
* Provide stdin during thumbnail generation
This commit is contained in:
WithoutPants
2022-04-25 15:56:06 +10:00
committed by GitHub
parent 9e606feb76
commit 1b91937004
6 changed files with 25 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"database/sql"
"errors"
"os/exec"
"path/filepath"
"time"
@@ -158,6 +159,11 @@ func (t *ScanTask) generateThumbnail(i *models.Image) {
// 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())
var exitErr *exec.ExitError
if errors.As(err, &exitErr) {
logger.Errorf("stderr: %s", string(exitErr.Stderr))
}
}
return
}