diff --git a/server/router/api/v1/attachment_service.go b/server/router/api/v1/attachment_service.go index 1efbf4a82..64f342904 100644 --- a/server/router/api/v1/attachment_service.go +++ b/server/router/api/v1/attachment_service.go @@ -558,7 +558,7 @@ func (s *APIV1Service) getOrGenerateThumbnail(attachment *store.Attachment) ([]b // Only resize if the image is larger than thumbnailMaxSize if max(width, height) > thumbnailMaxSize { - if width > height { + if width >= height { // Landscape or square - constrain width, maintain aspect ratio for height thumbnailWidth = thumbnailMaxSize thumbnailHeight = 0 diff --git a/web/src/components/MemoAttachmentListView.tsx b/web/src/components/MemoAttachmentListView.tsx index 08ddfb98f..7749fb0e2 100644 --- a/web/src/components/MemoAttachmentListView.tsx +++ b/web/src/components/MemoAttachmentListView.tsx @@ -1,7 +1,7 @@ import { memo, useState } from "react"; import { cn } from "@/lib/utils"; import { Attachment } from "@/types/proto/api/v1/attachment_service"; -import { getAttachmentType, getAttachmentUrl, getAttachmentThumbnailUrl } from "@/utils/attachment"; +import { getAttachmentThumbnailUrl, getAttachmentType, getAttachmentUrl } from "@/utils/attachment"; import MemoAttachment from "./MemoAttachment"; import PreviewImageDialog from "./PreviewImageDialog";