@@ -22,6 +22,8 @@ import { extractFocalLength } from './extractFocalLength'
2222import styles from './FovSimulator.module.css'
2323import { useToolSession } from '@/lib/analytics/hooks/useToolSession'
2424
25+ const COMPARISON_STEPS = [ 24 , 35 , 50 , 85 , 135 , 200 ] as const
26+
2527export function FovSimulator ( ) {
2628 const t = useTranslations ( 'toolUI.fov-simulator' )
2729 const { trackParam } = useToolSession ( )
@@ -44,6 +46,7 @@ export function FovSimulator() {
4446 setCustomImageSrc ( URL . createObjectURL ( file ) )
4547 dispatch ( { type : 'SET_IMAGE' , payload : - 1 } )
4648 const exif = await extractFocalLength ( file )
49+ const detected = exif . focalLength35 ?? exif . focalLength
4750 if ( exif . focalLength35 ) {
4851 setSourceFocalLength ( exif . focalLength35 )
4952 setExifDetected ( 'fl35' )
@@ -54,6 +57,11 @@ export function FovSimulator() {
5457 setSourceFocalLength ( null )
5558 setExifDetected ( null )
5659 }
60+ if ( detected ) {
61+ dispatch ( { type : 'SET_LENS' , payload : { index : 0 , updates : { focalLength : detected } } } )
62+ const comparison = COMPARISON_STEPS . find ( ( f ) => f > detected ) ?? 135
63+ dispatch ( { type : 'SET_LENS' , payload : { index : 1 , updates : { focalLength : comparison } } } )
64+ }
5765 } , [ customImageSrc ] )
5866
5967 const handleCustomRemove = useCallback ( ( ) => {
0 commit comments