From c05aa4df5fd625275fe259b21e9434b043a0bdc3 Mon Sep 17 00:00:00 2001 From: Daniel Mason Date: Sat, 8 Jan 2022 22:41:32 +1300 Subject: [PATCH] 0.1.51 - Fixed image resize to maintain aspect ratio --- .gitlab-ci.yml | 2 +- docs/changelog.md | 3 +++ internal/goscrobble/image.go | 2 +- internal/goscrobble/server.go | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f94275c..b8ff94f1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ stages: - build variables: - VERSION: 0.1.4 + VERSION: 0.1.51 build-go: image: golang:1.17 diff --git a/docs/changelog.md b/docs/changelog.md index 40c9b1db..9957ff57 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,3 +1,6 @@ +# 0.1.51 +- Fixed image resize to maintain aspect ratio + # 0.1.5 - Add image upload endpoints for artist/albums @ v1/albums/{uuid}/upload diff --git a/internal/goscrobble/image.go b/internal/goscrobble/image.go index 3a8a10e7..946699c0 100644 --- a/internal/goscrobble/image.go +++ b/internal/goscrobble/image.go @@ -114,7 +114,7 @@ func resizeImage(uuid string, size int) bool { } // Resize image to specified size - resizedImage := imaging.Resize(src, size, size, imaging.Lanczos) + resizedImage := imaging.Resize(src, size, 0, imaging.Lanczos) // Save resized image err = imaging.Save(resizedImage, DataDirectory+string(os.PathSeparator)+"img"+string(os.PathSeparator)+uuid+"_300px.jpg") diff --git a/internal/goscrobble/server.go b/internal/goscrobble/server.go index 99bf4abb..3e0cc6be 100644 --- a/internal/goscrobble/server.go +++ b/internal/goscrobble/server.go @@ -825,7 +825,7 @@ func getServerInfo(w http.ResponseWriter, r *http.Request) { } info := ServerInfo{ - Version: "0.1.4", + Version: "0.1.51", RegistrationEnabled: registrationEnabled, }