fix(server): copy relevant panorama tags to preview image (#23953)

This commit is contained in:
Mees Frensel
2025-11-19 04:02:12 +01:00
committed by GitHub
parent 4462952564
commit 271a42ac7f
4 changed files with 36 additions and 0 deletions

View File

@@ -121,6 +121,23 @@ export class MediaRepository {
}
}
async copyTagGroup(tagGroup: string, source: string, target: string): Promise<boolean> {
try {
await exiftool.write(
target,
{},
{
ignoreMinorErrors: true,
writeArgs: ['-TagsFromFile', source, `-${tagGroup}:all>${tagGroup}:all`, '-overwrite_original'],
},
);
return true;
} catch (error: any) {
this.logger.warn(`Could not copy tag data to image: ${error.message}`);
return false;
}
}
decodeImage(input: string | Buffer, options: DecodeToBufferOptions) {
return this.getImageDecodingPipeline(input, options).raw().toBuffer({ resolveWithObject: true });
}