Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
parent
7ed5e0d122
commit
4bd632881b
1 changed files with 3 additions and 2 deletions
|
@ -3,6 +3,7 @@ package photoprism
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"image"
|
"image"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/disintegration/imaging"
|
"github.com/disintegration/imaging"
|
||||||
|
@ -98,9 +99,9 @@ func (m *MediaFile) CreateThumbnails(thumbPath string, force bool) (err error) {
|
||||||
if original == nil {
|
if original == nil {
|
||||||
img, err := thumb.Open(m.FileName(), m.Orientation())
|
img, err := thumb.Open(m.FileName(), m.Orientation())
|
||||||
|
|
||||||
// Handle error and try to fix broken JPEGs if possible.
|
// Try to fix broken JPEGs if possible, fail otherwise.
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err.Error() != "invalid JPEG format: bad RST marker while decoding" {
|
if !strings.HasPrefix(err.Error(), "invalid JPEG format") {
|
||||||
log.Debugf("media: %s in %s", err.Error(), clean.Log(m.RootRelName()))
|
log.Debugf("media: %s in %s", err.Error(), clean.Log(m.RootRelName()))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue