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

Merge pull request #410 from desertwitch/master

EXIF rating
This commit is contained in:
Patrik J. Braun 2022-01-18 15:13:43 +01:00 committed by GitHub
commit 1d77f09ba1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,6 +221,7 @@ export class MetadataLoader {
const exif = ExifReader.load(data); const exif = ExifReader.load(data);
if (exif.Rating) { if (exif.Rating) {
metadata.rating = (parseInt(exif.Rating.value, 10) as any); metadata.rating = (parseInt(exif.Rating.value, 10) as any);
if(metadata.rating < 0) { metadata.rating = 0; }
} }
if (exif.subject && exif.subject.value && exif.subject.value.length > 0) { if (exif.subject && exif.subject.value && exif.subject.value.length > 0) {
if (metadata.keywords === undefined) { if (metadata.keywords === undefined) {