photoprism/internal/photoprism/resample_worker.go
Michael Mayer 02810ffa94 Sync: Import/index after downloading #225
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-04-06 22:09:45 +02:00

22 lines
405 B
Go

package photoprism
type ResampleJob struct {
mediaFile *MediaFile
path string
force bool
}
func ResampleWorker(jobs <-chan ResampleJob) {
for job := range jobs {
mf := job.mediaFile
if mf == nil {
log.Error("resample: media file is nil - might be a bug")
continue
}
if err := mf.ResampleDefault(job.path, job.force); err != nil {
log.Errorf("resample: %s", err)
}
}
}