dont check for exif in non image files
This commit is contained in:
parent
e491234f48
commit
5cbba12850
|
@ -88,6 +88,9 @@ export function FileInfo({
|
|||
const closeExif = () => setShowExif(false);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('file.metadata', file?.metadata);
|
||||
console.log('location', location);
|
||||
|
||||
if (!location && file && file.metadata) {
|
||||
if (file.metadata.longitude || file.metadata.longitude === 0) {
|
||||
setLocation({
|
||||
|
@ -99,6 +102,8 @@ export function FileInfo({
|
|||
}, [file]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('exif', exif);
|
||||
console.log('location', location);
|
||||
if (!location && exif) {
|
||||
const exifLocation = getEXIFLocation(exif);
|
||||
if (exifLocation.latitude || exifLocation.latitude === 0) {
|
||||
|
|
|
@ -307,6 +307,11 @@ function PhotoViewer(props: Iprops) {
|
|||
});
|
||||
photoSwipe.listen('beforeChange', () => {
|
||||
const currItem = photoSwipe?.currItem as EnteFile;
|
||||
updateFavButton(currItem);
|
||||
if (currItem.metadata.fileType !== FILE_TYPE.IMAGE) {
|
||||
setExif({ key: currItem.src, value: null });
|
||||
return;
|
||||
}
|
||||
if (
|
||||
!currItem ||
|
||||
!exifCopy?.current?.value === null ||
|
||||
|
@ -316,10 +321,13 @@ function PhotoViewer(props: Iprops) {
|
|||
}
|
||||
setExif({ key: currItem.src, value: undefined });
|
||||
checkExifAvailable(currItem);
|
||||
updateFavButton(currItem);
|
||||
});
|
||||
photoSwipe.listen('resize', () => {
|
||||
const currItem = photoSwipe?.currItem as EnteFile;
|
||||
if (currItem.metadata.fileType !== FILE_TYPE.IMAGE) {
|
||||
setExif({ key: currItem.src, value: null });
|
||||
return;
|
||||
}
|
||||
if (
|
||||
!currItem ||
|
||||
!exifCopy?.current?.value === null ||
|
||||
|
|
Loading…
Reference in a new issue