File tree Expand file tree Collapse file tree
apps/web/src/components/ui/photo-viewer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,6 +102,8 @@ export const ProgressiveImage = ({
102102 const showContextMenu = useShowContextMenu ( )
103103
104104 const isHDRSupported = useMediaQuery ( '(dynamic-range: high)' )
105+ // Only use HDR if the browser supports it and the image is HDR
106+ const shouldUseHDR = isHDR && isHDRSupported
105107
106108 return (
107109 < div
@@ -137,7 +139,7 @@ export const ProgressiveImage = ({
137139 } }
138140 >
139141 { /* LivePhoto 或 HDR 模式使用 DOMImageViewer */ }
140- { isLivePhoto || ( isHDR && isHDRSupported ) ? (
142+ { isLivePhoto || shouldUseHDR ? (
141143 < DOMImageViewer
142144 ref = { domImageViewerRef }
143145 onZoomChange = { onDOMTransformed }
@@ -190,7 +192,7 @@ export const ProgressiveImage = ({
190192 />
191193 ) }
192194
193- { isHDR && highResLoaded && blobSrc && isCurrentImage && ! error && (
195+ { shouldUseHDR && highResLoaded && blobSrc && isCurrentImage && ! error && (
194196 < HDRBadge />
195197 ) }
196198
You can’t perform that action at this time.
0 commit comments