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; }