summaryrefslogtreecommitdiff
path: root/src/cgg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgg.c')
-rw-r--r--src/cgg.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cgg.c b/src/cgg.c
index 92debc8..f5776b4 100644
--- a/src/cgg.c
+++ b/src/cgg.c
@@ -20,6 +20,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
+#include <time.h>
#include <glib.h>
#include <glib/gthread.h>
@@ -32,6 +33,7 @@
#include "setup.h"
#include "job-manager.h"
+#include "stats.h"
@@ -106,6 +108,8 @@ main(int argc, char* argv[])
gboolean verbose;
int jobs;
TGallerySetup *setup;
+ time_t time_start = time (NULL);
+ time_t time_stop;
/*
* this initialize the library and check potential ABI mismatches
@@ -151,10 +155,28 @@ main(int argc, char* argv[])
}
+ stats_errors = 0;
+ stats_dirs = 0;
+ stats_images = 0;
+
+ /* Print banner */
+ if (verbose)
+ printf ("cgg v%s [%s]\n\n", VERSION, APP_BUILD_DATE);
+
/* Start building the gallery tree */
setup->verbose = verbose;
build_tree (setup, source_dir, dst_dir, NULL, -1, jobs);
+ if (verbose) {
+ time_stop = time (NULL);
+ printf ("\nProcessed %d images in %d albums, elapsed time = %dm %ds\n", stats_images, stats_dirs, (int) ((time_stop - time_start) / 60), (int) ((time_stop - time_start) % 60));
+ if (stats_errors == 1)
+ printf ("%d error occured.\n", stats_errors);
+ if (stats_errors > 1)
+ printf ("%d errors occured.\n", stats_errors);
+ }
+
+
MagickWandTerminus();