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.
|
else if (node.mode === "worldmap" && (msg.payload.action !== "file" || msg.payload.type.indexOf("image") === -1)) { return; } // in case worldmap-in not filtered.
|
||||||
try {
|
try {
|
||||||
var value = RED.util.getMessageProperty(msg,node.property);
|
var value = RED.util.getMessageProperty(msg,node.property);
|
||||||
|
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
if (typeof value === "string") { // it must be a base64 encoded inline image type
|
if (typeof value === "string") { // it must be a base64 encoded inline image type
|
||||||
if (value.indexOf('data:image') !== -1) {
|
if (value.indexOf('data:image') !== -1) {
|
||||||
value = new Buffer.from(value.replace(/^data:image\/[a-z]+;base64,/, ""), 'base64');
|
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
|
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) {
|
for (const p in msg.exif) {
|
||||||
if (msg.exif.hasOwnProperty(p)) {
|
if (msg.exif.hasOwnProperty(p)) {
|
||||||
msg.exif[p] = msg.exif[p].description
|
msg.exif[p] = msg.exif[p].description
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-node-exif",
|
"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.",
|
"description": "A Node-RED node that extracts Exif information from JPEG image buffers.",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"exifreader": "^4.20.0"
|
"exifreader": "^4.26.1"
|
||||||
},
|
},
|
||||||
"bundledDependencies": [
|
"bundledDependencies": [
|
||||||
"exifreader"
|
"exifreader"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user