mirror of
				https://github.com/KevinMidboe/immich.git
				synced 2025-10-29 17:40:28 +00: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:
		@@ -50,10 +50,11 @@ export class MetadataExtractionProcessor {
 | 
			
		||||
  async extractExifInfo(job: Job<IExifExtractionProcessor>) {
 | 
			
		||||
    try {
 | 
			
		||||
      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);
 | 
			
		||||
 | 
			
		||||
      const exifData = await exifr.parse(fileBuffer);
 | 
			
		||||
      if (!exifData) {
 | 
			
		||||
        throw new Error(`can not fetch exif data from file ${asset.originalPath}`);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      const newExif = new ExifEntity();
 | 
			
		||||
      newExif.assetId = asset.id;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user