mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
bump to latest libs, fix reading correct property
This commit is contained in:
parent
14f68063c5
commit
0b556bade8
@ -81,14 +81,18 @@ module.exports = function(RED) {
|
||||
else if (node.mode === "worldmap" && (msg.payload.action !== "file" || msg.payload.type.indexOf("image") === -1)) { return; } // in case worldmap-in not filtered.
|
||||
try {
|
||||
var value = RED.util.getMessageProperty(msg,node.property);
|
||||
|
||||
if (value !== undefined) {
|
||||
if (typeof value === "string") { // it must be a base64 encoded inline image type
|
||||
if (value.indexOf('data:image') !== -1) {
|
||||
value = new Buffer.from(value.replace(/^data:image\/[a-z]+;base64,/, ""), 'base64');
|
||||
}
|
||||
else {
|
||||
value = new Buffer.from(value, 'base64');
|
||||
}
|
||||
}
|
||||
if (Buffer.isBuffer(value)) { // or a proper jpg buffer
|
||||
msg.exif = ExifReader.load(msg.payload);
|
||||
msg.exif = ExifReader.load(value);
|
||||
for (const p in msg.exif) {
|
||||
if (msg.exif.hasOwnProperty(p)) {
|
||||
msg.exif[p] = msg.exif[p].description
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "node-red-node-exif",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.0",
|
||||
"description": "A Node-RED node that extracts Exif information from JPEG image buffers.",
|
||||
"dependencies": {
|
||||
"exifreader": "^4.20.0"
|
||||
"exifreader": "^4.26.1"
|
||||
},
|
||||
"bundledDependencies": [
|
||||
"exifreader"
|
||||
|
Loading…
x
Reference in New Issue
Block a user