Import: Create thumbs for related JPEG files #602

This commit is contained in:
Michael Mayer 2020-11-15 15:55:02 +01:00
parent 28f59947df
commit df3b125f27

View file

@ -1,6 +1,7 @@
package photoprism
import (
"github.com/photoprism/photoprism/internal/query"
"os"
"path"
"path/filepath"
@ -167,6 +168,13 @@ func ImportWorker(jobs <-chan ImportJob) {
res := ind.MediaFile(f, indexOpt, "")
if res.Indexed() && f.IsJpeg() {
if err := f.ResampleDefault(ind.thumbPath(), false); err != nil {
log.Errorf("import: failed creating thumbnails for %s (%s)", txt.Quote(f.BaseName()), err.Error())
query.SetFileError(res.FileUID, err.Error())
}
}
log.Infof("import: %s related %s file %s", res, f.FileType(), txt.Quote(f.RelName(ind.originalsPath())))
}