From 93ded6bee7cfb76ffa4082b384d05c1dcb87153f Mon Sep 17 00:00:00 2001 From: pjft Date: Sat, 12 Dec 2020 21:41:01 +0000 Subject: [PATCH] Add support for embedded Picasa XMP face tags --- exif.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/exif.js b/exif.js index 0fe5b3e..7d3cfe8 100644 --- a/exif.js +++ b/exif.js @@ -38,7 +38,17 @@ function getFromImage(filename) { let faces = []; if (Object.prototype.hasOwnProperty.call(tags, "PersonInImage")) faces = tags.PersonInImage; - + // support for Picasa embedded face regions + else if (Object.prototype.hasOwnProperty.call(tags, "RegionInfo")) { + out = []; + for (i=0; i < tags.RegionInfo.RegionList.length; i++) { + if (tags.RegionInfo.RegionList[i].Name) + out[i] = tags.RegionInfo.RegionList[i].Name; + } + //console.log("Found Region Names: ", out); + faces = out; + } + resolve({ modif: modif, faces: faces, @@ -64,4 +74,4 @@ function end() { module.exports = { getFromImage: getFromImage, end: end -}; \ No newline at end of file +};