Commit 39dee1e85f375931e5e49f345f898cd7bdaa6990
1 parent
e095c645
When given an empty output for enroll, discard templates
This instead of saving everything to a memGallery by default, which is of questionable utility, and can give the appearance of a memory leak when not expected.
Showing
1 changed file
with
7 additions
and
3 deletions
openbr/core/core.cpp
| @@ -172,9 +172,10 @@ struct AlgorithmCore | @@ -172,9 +172,10 @@ struct AlgorithmCore | ||
| 172 | qDebug("Enrolling %s%s", qPrintable(input.flat()), | 172 | qDebug("Enrolling %s%s", qPrintable(input.flat()), |
| 173 | gallery.isNull() ? "" : qPrintable(" to " + gallery.flat())); | 173 | gallery.isNull() ? "" : qPrintable(" to " + gallery.flat())); |
| 174 | 174 | ||
| 175 | + bool noOutput = false; | ||
| 175 | if (gallery.name.isEmpty()) { | 176 | if (gallery.name.isEmpty()) { |
| 176 | if (input.name.isEmpty()) return; | 177 | if (input.name.isEmpty()) return; |
| 177 | - else gallery = getMemoryGallery(input); | 178 | + else noOutput = true; |
| 178 | } | 179 | } |
| 179 | 180 | ||
| 180 | bool multiProcess = Globals->file.getBool("multiProcess", false); | 181 | bool multiProcess = Globals->file.getBool("multiProcess", false); |
| @@ -200,12 +201,15 @@ struct AlgorithmCore | @@ -200,12 +201,15 @@ struct AlgorithmCore | ||
| 200 | QString outputDesc; | 201 | QString outputDesc; |
| 201 | if (fileExclusion) | 202 | if (fileExclusion) |
| 202 | outputDesc = "FileExclusion(" + gallery.flat() + ")+"; | 203 | outputDesc = "FileExclusion(" + gallery.flat() + ")+"; |
| 203 | - outputDesc.append("GalleryOutput("+gallery.flat()+")"); | 204 | + if (!noOutput) |
| 205 | + outputDesc.append("GalleryOutput("+gallery.flat()+")+"); | ||
| 206 | + | ||
| 207 | + outputDesc = outputDesc + "DiscardTemplates"; | ||
| 204 | stages.append(progressCounter.data()); | 208 | stages.append(progressCounter.data()); |
| 205 | 209 | ||
| 206 | QScopedPointer<Transform> pipeline(pipeTransforms(stages)); | 210 | QScopedPointer<Transform> pipeline(pipeTransforms(stages)); |
| 207 | 211 | ||
| 208 | - QScopedPointer<Transform> stream(wrapTransform(pipeline.data(), "Stream(readMode=StreamGallery, endPoint="+outputDesc+"+DiscardTemplates)")); | 212 | + QScopedPointer<Transform> stream(wrapTransform(pipeline.data(), "Stream(readMode=StreamGallery, endPoint="+outputDesc+")")); |
| 209 | 213 | ||
| 210 | TemplateList data, output; | 214 | TemplateList data, output; |
| 211 | data.append(input); | 215 | data.append(input); |