From 10a18914da3c7ef70b7004f5f193c3684331cb48 Mon Sep 17 00:00:00 2001 From: Theresa Gresch Date: Thu, 4 Jul 2019 18:39:54 +0200 Subject: [PATCH] Add HEIF as possible main file format --- internal/photoprism/mediafile.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/photoprism/mediafile.go b/internal/photoprism/mediafile.go index ec80dfa86..318024d18 100644 --- a/internal/photoprism/mediafile.go +++ b/internal/photoprism/mediafile.go @@ -279,6 +279,8 @@ func (m *MediaFile) RelatedFiles() (result MediaFiles, mainFile *MediaFile, err mainFile = resultFile } else if resultFile.IsRaw() { mainFile = resultFile + } else if resultFile.IsHEIF() { + mainFile = resultFile } else if resultFile.IsJpeg() && len(mainFile.Filename()) > len(resultFile.Filename()) { mainFile = resultFile } @@ -359,7 +361,7 @@ func (m *MediaFile) Basename() string { // DirectoryBasename returns the directory and base filename without any extensions. func (m *MediaFile) DirectoryBasename() string { - return m.Directory() + string(os.PathSeparator) + m.Basename() + return m.Directory() + string(os.PathSeparator) + m.Basename() } // MimeType returns the mimetype.