-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
93 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { parseShotEquipment } from "@kfs/common/api/utils"; | ||
import { getMetadata } from "@kfs/common/api/webServer/exif"; | ||
import { getSysConfig } from "@kfs/common/hox/sysConfig"; | ||
import { useEffect, useState } from 'react'; | ||
import { TouchableHighlight, View } from 'react-native'; | ||
import { Appbar, Text } from "react-native-paper"; | ||
|
||
function formatTime(DateTime, SubsecTime, OffsetTime) { | ||
let t = ""; | ||
if (DateTime) { | ||
t += DateTime; | ||
} | ||
if (SubsecTime) { | ||
t += "." + SubsecTime; | ||
} | ||
if (OffsetTime) { | ||
t += " " + OffsetTime; | ||
} | ||
return t; | ||
} | ||
|
||
function parseLocation(metadata) { | ||
let { exif } = metadata; | ||
if (exif) { | ||
let t = ""; | ||
if (exif.GPSLatitudeRef) { | ||
t += exif.GPSLatitudeRef + exif.GPSLatitude + ", " + exif.GPSLongitudeRef + exif.GPSLongitude; | ||
} | ||
return t; | ||
} | ||
} | ||
|
||
export default function ({ navigation, route }) { | ||
const { hash } = route.params; | ||
const [metadata, setMetadata] = useState(); | ||
const [sameFiles, setSameFiles] = useState([]); | ||
const sysConfig = getSysConfig(); | ||
useEffect(() => { | ||
getMetadata(hash).then(setMetadata); | ||
// listDriverFileByHash(hash).then(sf => { | ||
// setSameFiles(sf); | ||
// }); | ||
}, []); | ||
console.log("Viewer", hash, metadata); | ||
return ( | ||
<> | ||
<Appbar.Header mode="center-aligned"> | ||
<Appbar.Content title="信息" /> | ||
<TouchableHighlight key={hash} onPress={() => navigation.pop()} > | ||
<Text>完成</Text> | ||
</TouchableHighlight> | ||
</Appbar.Header> | ||
{!metadata ? | ||
<View style={{ | ||
flex: 1, | ||
alignItems: 'center', | ||
justifyContent: 'center' | ||
}}> | ||
<Text >TODO</Text> | ||
</View> : <> | ||
<Text>哈希值:{hash}</Text> | ||
{metadata.exif && <> | ||
<Text>原始时间:{formatTime(metadata.exif.DateTimeOriginal, metadata.exif.SubsecTimeOriginal, metadata.exif.OffsetTimeOriginal)}</Text> | ||
<Text>数字化时间:{formatTime(metadata.exif.DateTimeDigitized, metadata.exif.SubsecTimeDigitized, metadata.exif.OffsetTimeDigitized)}</Text> | ||
<Text>修改时间:{formatTime(metadata.exif.DateTime, metadata.exif.SubsecTime, metadata.exif.OffsetTime)}</Text> | ||
<Text>图片信息:{ }</Text> | ||
<Text>相机信息:{parseShotEquipment(metadata)}</Text> | ||
<Text>位置:{parseLocation(metadata)}</Text> | ||
</>} | ||
</>} | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters