From 39dee1e85f375931e5e49f345f898cd7bdaa6990 Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Mon, 22 Dec 2014 00:27:27 -0500 Subject: [PATCH] When given an empty output for enroll, discard templates --- openbr/core/core.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openbr/core/core.cpp b/openbr/core/core.cpp index a58cd4d..83566ee 100644 --- a/openbr/core/core.cpp +++ b/openbr/core/core.cpp @@ -172,9 +172,10 @@ struct AlgorithmCore qDebug("Enrolling %s%s", qPrintable(input.flat()), gallery.isNull() ? "" : qPrintable(" to " + gallery.flat())); + bool noOutput = false; if (gallery.name.isEmpty()) { if (input.name.isEmpty()) return; - else gallery = getMemoryGallery(input); + else noOutput = true; } bool multiProcess = Globals->file.getBool("multiProcess", false); @@ -200,12 +201,15 @@ struct AlgorithmCore QString outputDesc; if (fileExclusion) outputDesc = "FileExclusion(" + gallery.flat() + ")+"; - outputDesc.append("GalleryOutput("+gallery.flat()+")"); + if (!noOutput) + outputDesc.append("GalleryOutput("+gallery.flat()+")+"); + + outputDesc = outputDesc + "DiscardTemplates"; stages.append(progressCounter.data()); QScopedPointer pipeline(pipeTransforms(stages)); - QScopedPointer stream(wrapTransform(pipeline.data(), "Stream(readMode=StreamGallery, endPoint="+outputDesc+"+DiscardTemplates)")); + QScopedPointer stream(wrapTransform(pipeline.data(), "Stream(readMode=StreamGallery, endPoint="+outputDesc+")")); TemplateList data, output; data.append(input); -- libgit2 0.21.4