Rearrange

This commit is contained in:
Manav Rathi
2024-07-26 14:54:51 +05:30
parent 689d3c4c82
commit 5995730659

View File

@@ -86,6 +86,17 @@ export const parseExif = (tags: RawExifTags) => {
return metadata;
};
/**
* Parse GPS location from the metadata embedded in the file.
*/
const parseLocation = (tags: RawExifTags) => {
const latitude = tags.gps?.Latitude;
const longitude = tags.gps?.Longitude;
return latitude !== undefined && longitude !== undefined
? { latitude, longitude }
: undefined;
};
/**
* Parse a single "best" creation date for an image from the metadata embedded
* in the file.
@@ -364,17 +375,6 @@ const parseIPTCDate = (
return new Date(s);
};
/**
* Parse GPS location from the metadata embedded in the file.
*/
const parseLocation = (tags: RawExifTags) => {
const latitude = tags.gps?.Latitude;
const longitude = tags.gps?.Longitude;
return latitude !== undefined && longitude !== undefined
? { latitude, longitude }
: undefined;
};
/**
* Parse the width and height of the image from the metadata embedded in the
* file.