fix(server): use GPSLongitudeRef and GPSLatitudeRef EXIF fields (#21445)

Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
This commit is contained in:
Rui Gonçalves
2025-10-21 15:12:22 +01:00
committed by GitHub
parent 9dffbaea98
commit dbd6dcb786
5 changed files with 33 additions and 27 deletions

View File

@@ -84,6 +84,7 @@ export class MetadataRepository {
numericTags: [...DefaultReadTaskOptions.numericTags, 'FocalLength', 'FileSize'],
/* eslint unicorn/no-array-callback-reference: off, unicorn/no-array-method-this-argument: off */
geoTz: (lat, lon) => geotz.find(lat, lon)[0],
geolocation: true,
// Enable exiftool LFS to parse metadata for files larger than 2GB.
readArgs: ['-api', 'largefilesupport=1'],
writeArgs: ['-api', 'largefilesupport=1', '-overwrite_original'],

View File

@@ -447,7 +447,10 @@ export class MetadataService extends BaseService {
* For RAW images in the CR2 or RAF format, the "ImageSize" value seems to be correct,
* but ImageWidth and ImageHeight are not correct (they contain the dimensions of the preview image).
*/
let [width, height] = exifTags.ImageSize?.split('x').map((dim) => Number.parseInt(dim) || undefined) || [];
let [width, height] =
exifTags.ImageSize?.toString()
?.split('x')
?.map((dim) => Number.parseInt(dim) || undefined) ?? [];
if (!width || !height) {
[width, height] = [exifTags.ImageWidth, exifTags.ImageHeight];
}