From e9d96e88493579b5fb1ce4841129670b5101b4f2 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Wed, 22 Mar 2023 17:41:07 +0100 Subject: [PATCH] Photos: Update file mod time when changing image orientation #464 Signed-off-by: Michael Mayer --- internal/api/file_orientation.go | 2 +- internal/photoprism/mediafile_thumbs.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/api/file_orientation.go b/internal/api/file_orientation.go index 5bcd75990..1f37f977a 100644 --- a/internal/api/file_orientation.go +++ b/internal/api/file_orientation.go @@ -32,7 +32,7 @@ func ChangeFileOrientation(router *gin.RouterGroup) { // Abort in read-only mode or if editing is disabled. if conf.ReadOnly() || !conf.Settings().Features.Edit { - Abort(c, http.StatusForbidden, i18n.ErrReadOnly) + c.AbortWithStatusJSON(http.StatusForbidden, i18n.NewResponse(http.StatusForbidden, i18n.ErrReadOnly)) return } else if conf.DisableExifTool() { c.AbortWithStatusJSON(http.StatusInternalServerError, "exiftool is disabled") diff --git a/internal/photoprism/mediafile_thumbs.go b/internal/photoprism/mediafile_thumbs.go index 9ab9c3210..a12a20264 100644 --- a/internal/photoprism/mediafile_thumbs.go +++ b/internal/photoprism/mediafile_thumbs.go @@ -160,11 +160,11 @@ func (m *MediaFile) CreateThumbnails(thumbPath string, force bool) (err error) { func (m *MediaFile) ChangeOrientation(val int) (err error) { if !m.IsPreviewImage() { // Skip. - return fmt.Errorf("not a preview image") + return fmt.Errorf("orientation can currently only be changed for jpeg and png files") } cnf := Config() - cmd := exec.Command(cnf.ExifToolBin(), "-overwrite_original", "-P", "-n", "-ModifyDate