2020-01-19 12:50:44 +01:00
|
|
|
package photoprism
|
|
|
|
|
2020-07-14 18:00:32 +02:00
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/photoprism/photoprism/pkg/txt"
|
|
|
|
)
|
2020-02-01 22:48:07 +01:00
|
|
|
|
2020-01-19 12:50:44 +01:00
|
|
|
type ConvertJob struct {
|
|
|
|
image *MediaFile
|
|
|
|
convert *Convert
|
|
|
|
}
|
|
|
|
|
2020-04-06 22:09:45 +02:00
|
|
|
func ConvertWorker(jobs <-chan ConvertJob) {
|
2020-01-19 12:50:44 +01:00
|
|
|
for job := range jobs {
|
2020-06-07 10:09:35 +02:00
|
|
|
if _, err := job.convert.ToJpeg(job.image); err != nil {
|
2020-07-14 11:00:49 +02:00
|
|
|
fileName := job.image.RelName(job.convert.conf.OriginalsPath())
|
2020-07-14 18:00:32 +02:00
|
|
|
log.Errorf("convert: %s in %s (jpeg)", strings.TrimSpace(err.Error()), txt.Quote(fileName))
|
2020-01-19 12:50:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|