From dbd6dcb78631ddcf1aa74589db4769ceca0276bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rui=20Gon=C3=A7alves?= Date: Tue, 21 Oct 2025 15:12:22 +0100 Subject: [PATCH] fix(server): use GPSLongitudeRef and GPSLatitudeRef EXIF fields (#21445) Co-authored-by: Daniel Dietzler --- e2e/package.json | 2 +- pnpm-lock.yaml | 50 ++++++++++--------- server/package.json | 2 +- .../src/repositories/metadata.repository.ts | 1 + server/src/services/metadata.service.ts | 5 +- 5 files changed, 33 insertions(+), 27 deletions(-) diff --git a/e2e/package.json b/e2e/package.json index 80762a387..56d982682 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -34,7 +34,7 @@ "eslint-config-prettier": "^10.1.8", "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-unicorn": "^60.0.0", - "exiftool-vendored": "^28.3.1", + "exiftool-vendored": "^31.1.0", "globals": "^16.0.0", "jose": "^5.6.3", "luxon": "^3.4.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 843db95a7..be6b2974b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -238,8 +238,8 @@ importers: specifier: ^60.0.0 version: 60.0.0(eslint@9.37.0(jiti@2.6.1)) exiftool-vendored: - specifier: ^28.3.1 - version: 28.8.0 + specifier: ^31.1.0 + version: 31.1.0 globals: specifier: ^16.0.0 version: 16.4.0 @@ -404,8 +404,8 @@ importers: specifier: 4.3.3 version: 4.3.3 exiftool-vendored: - specifier: ^28.8.0 - version: 28.8.0 + specifier: ^31.1.0 + version: 31.1.0 express: specifier: ^5.1.0 version: 5.1.0 @@ -3495,8 +3495,8 @@ packages: peerDependencies: '@photo-sphere-viewer/core': 5.14.0 - '@photostructure/tz-lookup@11.2.0': - resolution: {integrity: sha512-DwrvodcXHNSdGdeSF7SBL5o8aBlsaeuCuG7633F04nYsL3hn5Hxe3z/5kCqxv61J1q7ggKZ27GPylR3x0cPNXQ==} + '@photostructure/tz-lookup@11.2.1': + resolution: {integrity: sha512-ugPtvpdLwGQ8IWezSGFgUCYOpO/XXetfKLNv+UN2jjTYyfIDq9dA21GydGyzXuoQ06nN3VGBd3JxmEu+ZtXScg==} '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} @@ -5210,9 +5210,9 @@ packages: resolution: {integrity: sha512-qsJ8/X+UypqxHXN75M7dF88jNK37dLBRW7LeUzCPz+TNs37G8cfWy9nWzS+LS//g600zrt2le9KuXt0rWfDz5Q==} hasBin: true - batch-cluster@13.0.0: - resolution: {integrity: sha512-EreW0Vi8TwovhYUHBXXRA5tthuU2ynGsZFlboyMJHCCUXYa2AjgwnE3ubBOJs2xJLcuXFJbi6c/8pH5+FVj8Og==} - engines: {node: '>=14'} + batch-cluster@15.0.1: + resolution: {integrity: sha512-eUmh0ld1AUPKTEmdzwGF9QTSexXAyt9rA1F5zDfW1wUi3okA3Tal4NLdCeFI6aiKpBenQhR6NmK9bW9tBHTGPQ==} + engines: {node: '>=20'} batch@0.6.1: resolution: {integrity: sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==} @@ -6547,16 +6547,18 @@ packages: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} - exiftool-vendored.exe@13.0.0: - resolution: {integrity: sha512-4zAMuFGgxZkOoyQIzZMHv1HlvgyJK3AkNqjAgm8A8V0UmOZO7yv3pH49cDV1OduzFJqgs6yQ6eG4OGydhKtxlg==} + exiftool-vendored.exe@13.38.0: + resolution: {integrity: sha512-oZx5enTAvSiIAXL+OEk7nNWrfUhEdKUpaGwDjCmz4VKwOa4HbisqyM808xPGPYj8X7XikcME/fq5hvevPeE3cw==} os: [win32] - exiftool-vendored.pl@13.0.1: - resolution: {integrity: sha512-+BRRzjselpWudKR0ltAW5SUt9T82D+gzQN8DdOQUgnSVWWp7oLCeTGBRptbQz+436Ihn/mPzmo/xnf0cv/Qw1A==} + exiftool-vendored.pl@13.38.0: + resolution: {integrity: sha512-Q3xl1nnwswrsR5344z4NyqvI74fKwla+VJHY1N+32gcDgt8cs9KBsDUwcNzKHSOSa/MjEfniuCJVrQiqR05iag==} os: ['!win32'] + hasBin: true - exiftool-vendored@28.8.0: - resolution: {integrity: sha512-R7tirJLr9fWuH9JS/KFFLB+O7jNGKuPXGxREc6YybYangEudGb+X8ERsYXk9AifMiAWh/2agNfbgkbcQcF+MxA==} + exiftool-vendored@31.1.0: + resolution: {integrity: sha512-q8StxLawHLDvhqv/uoBYCfVbDskn49Cr5ouNCZhh4lgryGu1aymHwK9AvO6RcW2SbPm5MSnQDJOfGp2MW5Nnrw==} + engines: {node: '>=20.0.0'} expect-type@1.2.1: resolution: {integrity: sha512-/kP8CAwxzLVEeFrMm4kMmy4CCDlpipyA7MYLVrdJIkV0fYF0UaigQHRsxHiuY/GEea+bh4KSv3TIlgr+2UL6bw==} @@ -15128,7 +15130,7 @@ snapshots: '@photo-sphere-viewer/core': 5.14.0 three: 0.180.0 - '@photostructure/tz-lookup@11.2.0': {} + '@photostructure/tz-lookup@11.2.1': {} '@pkgjs/parseargs@0.11.0': optional: true @@ -17069,7 +17071,7 @@ snapshots: baseline-browser-mapping@2.8.15: {} - batch-cluster@13.0.0: {} + batch-cluster@15.0.1: {} batch@0.6.1: {} @@ -18608,21 +18610,21 @@ snapshots: signal-exit: 3.0.7 strip-final-newline: 2.0.0 - exiftool-vendored.exe@13.0.0: + exiftool-vendored.exe@13.38.0: optional: true - exiftool-vendored.pl@13.0.1: {} + exiftool-vendored.pl@13.38.0: {} - exiftool-vendored@28.8.0: + exiftool-vendored@31.1.0: dependencies: - '@photostructure/tz-lookup': 11.2.0 + '@photostructure/tz-lookup': 11.2.1 '@types/luxon': 3.7.1 - batch-cluster: 13.0.0 - exiftool-vendored.pl: 13.0.1 + batch-cluster: 15.0.1 + exiftool-vendored.pl: 13.38.0 he: 1.2.0 luxon: 3.7.2 optionalDependencies: - exiftool-vendored.exe: 13.0.0 + exiftool-vendored.exe: 13.38.0 expect-type@1.2.1: {} diff --git a/server/package.json b/server/package.json index 477f25fa2..a7927e5ac 100644 --- a/server/package.json +++ b/server/package.json @@ -68,7 +68,7 @@ "cookie": "^1.0.2", "cookie-parser": "^1.4.7", "cron": "4.3.3", - "exiftool-vendored": "^28.8.0", + "exiftool-vendored": "^31.1.0", "express": "^5.1.0", "fast-glob": "^3.3.2", "fluent-ffmpeg": "^2.1.2", diff --git a/server/src/repositories/metadata.repository.ts b/server/src/repositories/metadata.repository.ts index e2360156e..6073ddcb2 100644 --- a/server/src/repositories/metadata.repository.ts +++ b/server/src/repositories/metadata.repository.ts @@ -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'], diff --git a/server/src/services/metadata.service.ts b/server/src/services/metadata.service.ts index 7d3de7655..b73a9b6bf 100644 --- a/server/src/services/metadata.service.ts +++ b/server/src/services/metadata.service.ts @@ -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]; }