pull/253/merge
Ed Bardsley 3 weeks ago committed by GitHub
commit 8d7a3aecbd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -25,6 +25,7 @@ class Metadata {
constructor (exiftool, picasa, opts) {
// standardise metadata
this.date = getDate(exiftool)
this.title = title(exiftool)
this.caption = caption(exiftool, picasa)
this.keywords = keywords(exiftool, picasa)
this.people = people(exiftool)
@ -78,6 +79,10 @@ function getFilenameDate (exif) {
return null
}
function title (exif) {
return tagValue(exif, 'EXIF', 'DocumentName')
}
function caption (exif, picasa) {
return picasaValue(picasa, 'caption') ||
tagValue(exif, 'EXIF', 'ImageDescription') ||

@ -131,6 +131,21 @@ describe('Metadata', function () {
})
})
describe('title', function () {
it('is read from EXIF', function () {
const exiftool = fixtures.exiftool()
exiftool.EXIF.DocumentName = 'some document name'
const meta = new Metadata(exiftool)
should(meta.title).eql('some document name')
})
it('can be missing', function () {
const exiftool = fixtures.exiftool()
const meta = new Metadata(exiftool)
should(meta.title).undefined()
})
})
describe('caption', function () {
it('is read from all standard EXIF/IPTC/XMP tags', function () {
const tags = [

Loading…
Cancel
Save