1
Fork 0

Fix: Correctly display counterpart JPGs for RAWs

This commit is contained in:
Théa Grondier 2021-08-22 17:08:35 +02:00
parent a9074dad21
commit 2dadca5e1e
1 changed files with 12 additions and 12 deletions

View File

@ -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
}