diff --git a/api/scanner/process_photo.go b/api/scanner/process_photo.go index de63cfea..75d61cfb 100644 --- a/api/scanner/process_photo.go +++ b/api/scanner/process_photo.go @@ -121,6 +121,18 @@ func processPhoto(tx *gorm.DB, imageData *media_encoding.EncodeMediaData, photoC return false, errors.Wrap(err, "could determine if media was photo or video") } + if mediaType.IsRaw() { + err = processRawSideCar(tx, imageData, highResURL, thumbURL, photoCachePath) + if err != nil { + return false, err + } + + counterpartFile := scanForCompressedCounterpartFile(photo.Path) + if counterpartFile != nil { + imageData.Media.CounterpartPath = counterpartFile + } + } + // Generate high res jpeg if highResURL == nil { @@ -202,18 +214,6 @@ func processPhoto(tx *gorm.DB, imageData *media_encoding.EncodeMediaData, photoC } } - if mediaType.IsRaw() { - err = processRawSideCar(tx, imageData, highResURL, thumbURL, photoCachePath) - if err != nil { - return false, err - } - - counterpartFile := scanForCompressedCounterpartFile(photo.Path) - if counterpartFile != nil { - photo.CounterpartPath = counterpartFile - } - } - return didProcess, nil }