From df3b125f271012b4adc07a6b33db23a7aff21adb Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Sun, 15 Nov 2020 15:55:02 +0100 Subject: [PATCH] Import: Create thumbs for related JPEG files #602 --- internal/photoprism/import_worker.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/photoprism/import_worker.go b/internal/photoprism/import_worker.go index 7dd6cd094..ae903c7be 100644 --- a/internal/photoprism/import_worker.go +++ b/internal/photoprism/import_worker.go @@ -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()))) }