mirror of
https://github.com/Afilmory/afilmory
synced 2026-02-01 22:48:17 +00:00
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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user