Commit 50ec84181c4c8e184bfdf7830a487878344743da

Authored by Charles Otto
1 parent 2fc318d4

Fix multiple input gallery enrollment

Showing 1 changed file with 15 additions and 11 deletions
openbr/core/core.cpp
... ... @@ -169,9 +169,6 @@ struct AlgorithmCore
169 169  
170 170 void enroll(File input, File gallery = File())
171 171 {
172   - qDebug("Enrolling %s%s", qPrintable(input.flat()),
173   - gallery.isNull() ? "" : qPrintable(" to " + gallery.flat()));
174   -
175 172 bool noOutput = false;
176 173 if (gallery.name.isEmpty()) {
177 174 if (input.name.isEmpty()) return;
... ... @@ -187,9 +184,6 @@ struct AlgorithmCore
187 184 fileExclusion = true;
188 185 }
189 186  
190   - Gallery *temp = Gallery::make(input);
191   - qint64 total = temp->totalSize();
192   -
193 187 Transform *enroll = simplifiedTransform.data();
194 188  
195 189 if (multiProcess)
... ... @@ -208,13 +202,23 @@ struct AlgorithmCore
208 202 stages.append(progressCounter.data());
209 203  
210 204 QScopedPointer<Transform> pipeline(pipeTransforms(stages));
211   -
212 205 QScopedPointer<Transform> stream(wrapTransform(pipeline.data(), "Stream(readMode=StreamGallery, endPoint="+outputDesc+")"));
213 206  
214   - TemplateList data, output;
215   - data.append(input);
216   - progressCounter->setPropertyRecursive("totalProgress", QString::number(total));
217   - stream->projectUpdate(data, output);
  207 + foreach (const br::File &file, input.split()) {
  208 + qDebug("Enrolling %s%s", qPrintable(file.name),
  209 + gallery.isNull() ? "" : qPrintable(" to " + gallery.flat()));
  210 +
  211 + Gallery *temp = Gallery::make(file);
  212 + qint64 total = temp->totalSize();
  213 + delete temp;
  214 +
  215 + progressCounter->setPropertyRecursive("totalProgress", QString::number(total));
  216 +
  217 + TemplateList data, output;
  218 + data.append(file);
  219 +
  220 + stream->projectUpdate(data, output);
  221 + }
218 222  
219 223 if (multiProcess)
220 224 delete enroll;
... ...