fix(server): Does not assign lat/lon if they are at 0,0 #2991 (#3669)

* fix(server): Does not assign lat/lon if they are at 0,0 #2991

* Adds migration file to fix null island rows

* Removed down migration

* Leave empty down function
This commit is contained in:
Russell Tan 2023-08-14 18:37:17 -07:00 committed by GitHub
parent 079aa13edb
commit f1b8a7ab54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 4 deletions

View file

@ -308,8 +308,16 @@ export class MetadataExtractionProcessor {
const latitude = getExifProperty('GPSLatitude');
const longitude = getExifProperty('GPSLongitude');
newExif.latitude = latitude !== null ? parseLatitude(latitude) : null;
newExif.longitude = longitude !== null ? parseLongitude(longitude) : null;
const lat = parseLatitude(latitude);
const lon = parseLongitude(longitude);
if (lat === 0 && lon === 0) {
this.logger.warn(`Latitude & Longitude were on Null Island (${lat},${lon}), not assigning coordinates`);
} else {
newExif.latitude = lat;
newExif.longitude = lon;
}
if (getExifProperty('MotionPhoto')) {
// Seen on more recent Pixel phones: starting as early as Pixel 4a, possibly earlier.
const rawDirectory = getExifProperty('Directory');