refactor(gallery): update image format handling in MasonryPhotoItem component

- Removed the generic image format extraction function and replaced it with direct access to the data format property.
- Simplified the display of image format information in the gallery layout.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2025-11-26 15:16:57 +08:00
parent ab4b64534c
commit 8fa559943c

View File

@@ -13,7 +13,6 @@ import {
} from '~/icons'
import { isMobileDevice } from '~/lib/device-viewport'
import { ImageLoaderManager } from '~/lib/image-loader-manager'
import { getImageFormat } from '~/lib/image-utils'
import type { PhotoManifest } from '~/types/photo'
export const MasonryPhotoItem = ({ data, width, index: _ }: { data: PhotoManifest; width: number; index: number }) => {
@@ -96,9 +95,6 @@ export const MasonryPhotoItem = ({ data, width, index: _ }: { data: PhotoManifes
const exifData = formatExifData()
// 使用通用的图片格式提取函数
const imageFormat = getImageFormat(data.originalUrl || data.s3Key || '')
// 检查是否有视频内容Live Photo 或 Motion Photo
const hasVideo = data.video !== undefined
@@ -312,7 +308,7 @@ export const MasonryPhotoItem = ({ data, width, index: _ }: { data: PhotoManifes
{/* 基本信息 */}
<div className="mb-2 flex flex-wrap gap-2 text-xs text-white/80 opacity-0 group-hover:opacity-100">
<span>{imageFormat}</span>
<span>{data.format}</span>
<span></span>
<span>
{data.width} × {data.height}