From 4640912b370b924ee6658f1ecc5ef60e179ce268 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Fri, 27 Jun 2014 10:21:53 -0400 Subject: [PATCH] JSONTransform bug fixes --- openbr/plugins/template.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openbr/plugins/template.cpp b/openbr/plugins/template.cpp index 6adb73a..1124303 100644 --- a/openbr/plugins/template.cpp +++ b/openbr/plugins/template.cpp @@ -107,9 +107,9 @@ class JSONTransform : public UntrainableMetaTransform void project(const Template &src, Template &dst) const { dst.file = src.file; - const QByteArray json = QJsonDocument(QJsonObject::fromVariantMap(src.file.localMetadata())).toJson(); - dst += cv::Mat(1, json.size(), CV_8UC1, (void*) json.data()); dst.file.set("AlgorithmID", 2); + const QByteArray json = QJsonDocument(QJsonObject::fromVariantMap(dst.file.localMetadata())).toJson(); + dst += cv::Mat(1, json.size()+1 /*include null terminator*/, CV_8UC1, (void*) json.data()).clone(); } }; -- libgit2 0.21.4