photoprism/internal/photoprism/resample_worker.go
Michael Mayer a604e9a9c6 Index: Improve file size/resolution checks, add WebP support #1017 #1226
Renames the config flag to from "megapixel-limit" to "resolution-limit".
Adds native support for the WebP image file format.
2022-04-02 18:04:11 +02:00

22 lines
406 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.CreateThumbnails(job.path, job.force); err != nil {
log.Errorf("resample: %s", err)
}
}
}