1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

#267 add XMP 'subject' to 'keywords' with proper encoding

This commit is contained in:
kagahd 2021-04-25 01:16:22 +02:00
parent bd3db9a308
commit f8b68e5c2c
4 changed files with 11 additions and 8 deletions

View File

@ -216,10 +216,14 @@ export class MetadataLoader {
if (exif.Rating) {
metadata.rating = (parseInt(exif.Rating.value, 10) as any);
}
if(exif.subject && exif.subject.value){
if(exif.subject && exif.subject.value && exif.subject.value.length > 0){
if(metadata.keywords == undefined) {
metadata.keywords = [];
}
for(let i=0; i < exif.subject.value.length; i++){
if(metadata.keywords.indexOf(exif.subject.value[i].value) == -1) {
metadata.keywords.push(exif.subject.value[i].value);
const kw = exif.subject.value[i].description;
if(metadata.keywords.indexOf(kw) == -1) {
metadata.keywords.push(kw);
}
}
}

View File

@ -20,6 +20,7 @@
}
],
"fileSize": 4381,
"keywords": [],
"orientation": 1,
"size": {
"height": 26,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -8,17 +8,15 @@
"model": "SM-G975F"
},
"creationDate": 1614703656000,
"fileSize": 7909,
"fileSize": 4709,
"orientation": 1,
"rating": 50,
"Rating": 3,
"keywords": [
"Max",
"Spaß",
"Yanik"
],
"size": {
"height": 47,
"width": 100
"height": 5,
"width": 10
}
}