diff --git a/sdk/core/core.cpp b/sdk/core/core.cpp index 22a078e..e09176a 100644 --- a/sdk/core/core.cpp +++ b/sdk/core/core.cpp @@ -112,7 +112,8 @@ struct AlgorithmCore QScopedPointer g(Gallery::make(gallery)); if (g.isNull()) return FileList(); FileList fileList = g->files(); - if (!fileList.isEmpty() && g->isUniversal()) return fileList; // Already enrolled + if (!fileList.isEmpty() && g->isUniversal() && !gallery.contains("append")) + return fileList; // Already enrolled const TemplateList i(TemplateList::fromInput(input)); if (i.isEmpty()) return FileList(); // Nothing to enroll @@ -133,13 +134,12 @@ struct AlgorithmCore if (data.isEmpty()) break; const int numFiles = data.size(); - if (!Globals->backProject){ - data >> *transform; + if (Globals->backProject) { + TemplateList backProjectedData; + transform->backProject(data, backProjectedData); + data = backProjectedData; } else { - // I don't really know if this makes sense. - //TemplateList dst; - transform->backProject(data, data); - //data = dst; + data >> *transform; } g->writeBlock(data); diff --git a/sdk/plugins/gallery.cpp b/sdk/plugins/gallery.cpp index de4b3a2..d0f954b 100644 --- a/sdk/plugins/gallery.cpp +++ b/sdk/plugins/gallery.cpp @@ -60,15 +60,20 @@ class galGallery : public Gallery void init() { gallery.setFileName(file); - - if (gallery.exists()) { - if (!gallery.open(QFile::ReadOnly)) qFatal("Can't open [%s] for reading.", qPrintable(gallery.fileName())); - stream.setDevice(&gallery); + QtUtils::touchDir(gallery); + + if (file.contains("append")) { + if (!gallery.open(QFile::Append)) + qFatal("Can't open [%s] for appending.", qPrintable(gallery.fileName())); + } else if (gallery.exists()) { + if (!gallery.open(QFile::ReadOnly)) + qFatal("Can't open [%s] for reading.", qPrintable(gallery.fileName())); } else { - QtUtils::touchDir(gallery); - if (!gallery.open(QFile::WriteOnly)) qFatal("Can't open [%s] for writing.", qPrintable(gallery.fileName())); - stream.setDevice(&gallery); + if (!gallery.open(QFile::WriteOnly)) + qFatal("Can't open [%s] for writing.", qPrintable(gallery.fileName())); } + + stream.setDevice(&gallery); } bool isUniversal() const diff --git a/share/openbr/doc b/share/openbr/doc index 1031e9e..504960d 160000 --- a/share/openbr/doc +++ b/share/openbr/doc @@ -1 +1 @@ -Subproject commit 1031e9e416427f5dd8e9f4e7ff4dd74632626c22 +Subproject commit 504960df12db25e09c39ab098fb8614c1db51617