Skip to content

Commit

Permalink
Ignore single images in batch mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelaya committed Dec 9, 2014
1 parent cf4c0d8 commit e692c82
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ int Launcher::automaticMerge() {
ImageIO io;
int result = 0;
for (LoadOptions & options : optionsSet) {
if (!options.withSingles && options.fileNames.size() == 1) {
Log::progress(tr("Skipping single image %1").arg(options.fileNames.front()));
continue;
}
CoutProgressIndicator progress;
int numImages = options.fileNames.size();
int result = io.load(options, progress);
Expand Down Expand Up @@ -168,6 +172,8 @@ void Launcher::parseCommandLine() {
generalOptions.crop = false;
} else if (string("--batch") == argv[i] || string("-B") == argv[i]) {
generalOptions.batch = true;
} else if (string("--single") == argv[i]) {
generalOptions.withSingles = true;
} else if (string("--help") == argv[i]) {
help = true;
} else if (string("-b") == argv[i]) {
Expand Down Expand Up @@ -240,6 +246,7 @@ void Launcher::showHelp() {
cout << " " << "-B|--batch " << tr("Batch mode: Input images are automatically grouped into bracketed sets,") << endl;
cout << " " << " " << tr("by comparing the creation time. Implies -a if no output file name is given.") << endl;
cout << " " << "-g gap " << tr("Batch gap, maximum difference in seconds between two images of the same set.") << endl;
cout << " " << "--single " << tr("Include single images in batch mode (the default is to skip them.)") << endl;
cout << " " << "-b BPS " << tr("Bits per sample, can be 16, 24 or 32.") << endl;
cout << " " << "--no-align " << tr("Do not auto-align source images.") << endl;
cout << " " << "--no-crop " << tr("Do not crop the output image to the optimum size.") << endl;
Expand Down
4 changes: 3 additions & 1 deletion LoadSaveOptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ struct LoadOptions {
bool crop;
bool batch;
double batchGap;
LoadOptions() : align(true), crop(true), batch(false), batchGap(2.0) {}
bool withSingles;
LoadOptions() : align(true), crop(true), batch(false), batchGap(2.0),
withSingles(false) {}
};


Expand Down
8 changes: 8 additions & 0 deletions hdrmerge_es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@
<source>Invalid %1 parameter, using default.</source>
<translation type="finished">Parámetro %1 inválido, se usará el valor por defecto.</translation>
</message>
<message>
<source>Include single images in batch mode (the default is to skip them.)</source>
<translation type="finished">Incluir imágenes sueltas en modo lote (por defecto se ignoran).</translation>
</message>
</context>
<context>
<name>LoadSave</name>
Expand Down Expand Up @@ -182,6 +186,10 @@
<source>Done writing!</source>
<translation type="finished">¡Escritura finalizada!</translation>
</message>
<message>
<source>Skipping single image %1</source>
<translation type="finished">Ignorando la imagen suelta %1</translation>
</message>
</context>
<context>
<name>hdrmerge::AboutDialog</name>
Expand Down

0 comments on commit e692c82

Please sign in to comment.