From 75ce261f740051f6feb30dc200066f945e88ce95 Mon Sep 17 00:00:00 2001 From: Elscrux Date: Fri, 19 Jul 2024 09:30:06 +0000 Subject: [PATCH] feat: downscaled image previews for task attachments (#2541) As discussed in [https://community.vikunja.io/t/add-scaled-down-images-for-image-previews](https://community.vikunja.io/t/add-scaled-down-images-for-image-previews) this adds a query parameter in the task attachment request which returns a scaled down image for preview purposes to reduce network load and improve responsiveness. Co-authored-by: Elscrux Reviewed-on: https://kolaente.dev/vikunja/vikunja/pulls/2541 Reviewed-by: konrad Co-authored-by: Elscrux Co-committed-by: Elscrux --- .../components/tasks/partials/FilePreview.vue | 4 +- .../components/tasks/partials/KanbanCard.vue | 8 +- frontend/src/services/attachment.ts | 16 ++- pkg/models/task_attachment.go | 97 ++++++++++++++++++- pkg/routes/api/v1/task_attachment.go | 31 +++++- 5 files changed, 146 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/tasks/partials/FilePreview.vue b/frontend/src/components/tasks/partials/FilePreview.vue index 306a2915e..a22c5a428 100644 --- a/frontend/src/components/tasks/partials/FilePreview.vue +++ b/frontend/src/components/tasks/partials/FilePreview.vue @@ -20,7 +20,7 @@