From 94424df08f6ebb07e7018e1f4eabfa724c78a9de Mon Sep 17 00:00:00 2001 From: Armored-Dragon Date: Mon, 20 Nov 2023 20:53:37 +0000 Subject: [PATCH] Deployment-Hotfixes (#5) Reviewed-on: https://git.armoreddragon.com/ArmoredDragon/yet-another-blog/pulls/5 Co-authored-by: Armored-Dragon Co-committed-by: Armored-Dragon --- backend/core/core.js | 4 ++-- frontend/public/css/blogNew.css | 3 ++- frontend/public/css/blogNew.scss | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/core/core.js b/backend/core/core.js index 547054a..8b7fd3f 100644 --- a/backend/core/core.js +++ b/backend/core/core.js @@ -230,7 +230,7 @@ async function deleteImage(image, requester_id) { const post = await getBlog({ id: image.parent, raw: true }); // Check if post exists - if (!post) return { success: false, message: "Post does not exist" }; + if (!post.success) return { success: false, message: "Post does not exist" }; // Check for permissions if (post.owner.id !== user.data.id || user.data.role !== "ADMIN") return { success: false, message: "User is not permitted" }; @@ -257,7 +257,7 @@ async function _uploadImage(parent_id, parent_type, is_thumbnail, buffer, name) const compressed_image = await sharp(buffer, { animated: true }) .resize({ ...size, withoutEnlargement: true, fit: "inside" }) - .webp({ quality: 90 }) + .webp({ quality: 90, animated: true }) .toBuffer(); const params = { diff --git a/frontend/public/css/blogNew.css b/frontend/public/css/blogNew.css index 6fd2595..6827db9 100644 --- a/frontend/public/css/blogNew.css +++ b/frontend/public/css/blogNew.css @@ -57,7 +57,8 @@ position: relative; } .e-image-area .image img { - height: 100%; + max-height: 100%; + max-width: 100%; margin: auto; } .e-image-area .image div { diff --git a/frontend/public/css/blogNew.scss b/frontend/public/css/blogNew.scss index 509640c..7fa4689 100644 --- a/frontend/public/css/blogNew.scss +++ b/frontend/public/css/blogNew.scss @@ -64,7 +64,8 @@ $background-body: #222; position: relative; img { - height: 100%; + max-height: 100%; + max-width: 100%; margin: auto; }