mirror of
https://github.com/immich-app/immich.git
synced 2025-01-07 00:50:23 -05:00
Server - Fixed - Use file path instead buffer to reduce memory usage on EXIF extraction (#545)
fix undefined exif data
This commit is contained in:
parent
f980a2f27a
commit
dfaa4969da
1 changed files with 4 additions and 3 deletions
|
@ -50,10 +50,11 @@ export class MetadataExtractionProcessor {
|
||||||
async extractExifInfo(job: Job<IExifExtractionProcessor>) {
|
async extractExifInfo(job: Job<IExifExtractionProcessor>) {
|
||||||
try {
|
try {
|
||||||
const { asset, fileName, fileSize }: { asset: AssetEntity; fileName: string; fileSize: number } = job.data;
|
const { asset, fileName, fileSize }: { asset: AssetEntity; fileName: string; fileSize: number } = job.data;
|
||||||
|
const exifData = await exifr.parse(asset.originalPath);
|
||||||
|
|
||||||
const fileBuffer = await readFile(asset.originalPath);
|
if (!exifData) {
|
||||||
|
throw new Error(`can not fetch exif data from file ${asset.originalPath}`);
|
||||||
const exifData = await exifr.parse(fileBuffer);
|
}
|
||||||
|
|
||||||
const newExif = new ExifEntity();
|
const newExif = new ExifEntity();
|
||||||
newExif.assetId = asset.id;
|
newExif.assetId = asset.id;
|
||||||
|
|
Loading…
Reference in a new issue