summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cgg.c17
-rw-r--r--src/generators.c5
-rw-r--r--src/setup.h1
3 files changed, 15 insertions, 8 deletions
diff --git a/src/cgg.c b/src/cgg.c
index 5950825..00cd63d 100644
--- a/src/cgg.c
+++ b/src/cgg.c
@@ -44,22 +44,24 @@
* parse_cmd: parse commandline and fill global variable parameters
*/
gboolean
-parse_cmd (int argc, char* argv[], gchar **source_dir, gchar **dst_dir, gboolean *verbose, int *jobs, gboolean *update)
+parse_cmd (int argc, char* argv[], gchar **source_dir, gchar **dst_dir, gboolean *verbose, int *jobs, gboolean *update, gboolean *override_nofullsize)
{
static gboolean _verbose = FALSE;
static gchar *_source_dir = NULL;
static gchar *_dst_dir = NULL;
static int _jobs = 1;
static gboolean _update = FALSE;
+ static gboolean _override_nofullsize = FALSE;
static GOptionEntry entries[] =
{
- { "verbose", 'v', 0, G_OPTION_ARG_NONE, &_verbose, "Be verbose", NULL },
- { "source", 's', 0, G_OPTION_ARG_STRING, &_source_dir, "Specifies a path to source structure", NULL },
- { "output", 'o', 0, G_OPTION_ARG_STRING, &_dst_dir, "Generate files to the specified directory instead of current", NULL },
+ { "verbose", 'v', 0, G_OPTION_ARG_NONE, &_verbose, "Be verbose", NULL },
+ { "source", 's', 0, G_OPTION_ARG_STRING, &_source_dir, "Specifies a path to source structure", NULL },
+ { "output", 'o', 0, G_OPTION_ARG_STRING, &_dst_dir, "Generate files to the specified directory instead of current", NULL },
{ "jobs", 'j', 0, G_OPTION_ARG_INT, &_jobs, "Allow N jobs at once (default=1)", NULL },
{ "update", 'u', 0, G_OPTION_ARG_NONE, &_update, "Update the output structure", NULL },
- { NULL }
+ { "fullsize", 'f', 0, G_OPTION_ARG_NONE, &_override_nofullsize, "Override the nofullsize switch and generate full gallery", NULL },
+ { NULL }
};
GError *error = NULL;
@@ -97,6 +99,7 @@ parse_cmd (int argc, char* argv[], gchar **source_dir, gchar **dst_dir, gboolean
*verbose = _verbose;
*jobs = _jobs;
*update = _update;
+ *override_nofullsize = _override_nofullsize;
return TRUE;
}
@@ -110,6 +113,7 @@ main (int argc, char* argv[])
gchar *dst_dir;
gboolean verbose;
gboolean update;
+ gboolean fullsize;
int jobs;
TGallerySetup *setup;
time_t time_start = time (NULL);
@@ -134,7 +138,7 @@ main (int argc, char* argv[])
/* Parse commandline */
- if (! parse_cmd (argc, argv, &source_dir, &dst_dir, &verbose, &jobs, &update))
+ if (! parse_cmd (argc, argv, &source_dir, &dst_dir, &verbose, &jobs, &update, &fullsize))
return -1;
if ((! source_dir) || (access (source_dir, R_OK))) {
@@ -172,6 +176,7 @@ main (int argc, char* argv[])
/* Start building the gallery tree */
setup->verbose = verbose;
setup->update_mode = update;
+ setup->override_nofullsize = fullsize;
build_tree (setup, source_dir, dst_dir, NULL, -1, jobs);
if (verbose) {
diff --git a/src/generators.c b/src/generators.c
index 8db260f..92b8cb2 100644
--- a/src/generators.c
+++ b/src/generators.c
@@ -150,7 +150,7 @@ generate_image (TGallerySetup *setup,
g_free (s1);
s1 = item_get_img_src (setup, items, item);
big_dst = g_strconcat (dst_dir, "/", setup->img_big_dir, "/", s1, NULL);
- if (item->force_fullsize || (items->fullsize && ! item->force_nofullsize) ||
+ if (item->force_fullsize || setup->override_nofullsize || (items->fullsize && ! item->force_nofullsize) ||
(! item->force_nofullsize && ! items->nofullsize && ! setup->nofullsize))
orig_dst = g_strconcat (dst_dir, "/", setup->img_orig_dir, "/", s1, NULL);
res = (! update_when_necessary) || needs_update (thumb_src_full, thumb_dst) ||
@@ -618,7 +618,8 @@ write_html_image (TGallerySetup *setup,
/* Retrieve image sizes of preview and original image */
get_image_sizes (big_dst, &img_big_w, &img_big_h);
- image_fullsize = item->force_fullsize || (parent_items->fullsize && ! item->force_nofullsize) ||
+ image_fullsize = item->force_fullsize || setup->override_nofullsize ||
+ (parent_items->fullsize && ! item->force_nofullsize) ||
(! item->force_nofullsize && ! parent_items->nofullsize && ! setup->nofullsize);
if (image_fullsize)
get_image_sizes (orig_dst, &img_orig_w, &img_orig_h);
diff --git a/src/setup.h b/src/setup.h
index fc04616..d4f275b 100644
--- a/src/setup.h
+++ b/src/setup.h
@@ -73,6 +73,7 @@ typedef struct {
gchar *border_style;
gboolean nofullsize;
+ gboolean override_nofullsize;
gboolean preload;
gboolean use_iptc_exif;