summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gallery-utils.c14
-rw-r--r--src/items.c26
-rw-r--r--src/job-manager.c3
-rw-r--r--src/jpeg-utils.cpp22
-rw-r--r--src/setup.c59
-rw-r--r--src/xml-parser.c25
6 files changed, 19 insertions, 130 deletions
diff --git a/src/gallery-utils.c b/src/gallery-utils.c
index 1ac8419..0c24886 100644
--- a/src/gallery-utils.c
+++ b/src/gallery-utils.c
@@ -73,11 +73,6 @@ str_replace (gchar **dst, const gchar *search, const gchar *replace)
}
d[i] = 0x0;
-
-#ifdef __DEBUG_ALL__
- printf ("str_replace('%s', '%s') = '%s' --> '%s'\n", search, replace, *dst, &d[0]);
-#endif
-
/* return fixed string */
g_free (*dst);
*dst = g_strdup (&d[0]);
@@ -222,11 +217,6 @@ fix_entities (gchar **str)
}
d[i] = 0x0;
-
-#ifdef __DEBUG_ALL__
- printf ("fix_entities: '%s' --> '%s'\n", *str, &d[0]);
-#endif
-
/* return fixed string */
g_free (*str);
*str = g_strdup (&d[0]);
@@ -258,10 +248,6 @@ remove_tags (gchar **str, const gchar *tag_begin, const gchar *tag_end)
dest = g_malloc0 (strlen (src) - (found2 - found) + 1);
memcpy (dest, src, found - src);
memcpy (dest + (found - src), found2, strlen (found2) + 1);
-#ifdef __DEBUG_ALL__
- printf ("found = %p, found2 = %p, strlen = %d, res = %d\n", found, found2, strlen (src), strlen (src) - (found2 - found) + 1);
- printf ("orig = %s, new = %s, strlen = %d\n", src, dest, strlen (dest));
-#endif
g_free (src);
src = g_strdup (dest);
g_free (dest);
diff --git a/src/items.c b/src/items.c
index 842f066..33311fd 100644
--- a/src/items.c
+++ b/src/items.c
@@ -57,9 +57,6 @@ parse_album_xml (const gchar *filename, TAlbum *index)
/* Retrieve gallery type */
gallery_type = xml_file_get_node_attribute (xml, "/gallery", "type");
- #ifdef __DEBUG_ALL__
- printf("gallery_type = %s\n", gallery_type);
- #endif
if (strcmp (gallery_type, "index") == 0)
index->type = GALLERY_TYPE_INDEX;
else
@@ -99,9 +96,6 @@ parse_album_xml (const gchar *filename, TAlbum *index)
/* Section Items */
count = xml_file_node_get_children_count (xml, "/gallery/items/*");
- #ifdef __DEBUG_ALL__
- printf("parse_album_xml: items count = %d\n", count);
- #endif
index->items = g_ptr_array_new();
for (i = 0; i < count; i++)
@@ -111,10 +105,8 @@ parse_album_xml (const gchar *filename, TAlbum *index)
s = g_strdup_printf ("/gallery/items/*[%d]", i + 1);
node_name = xml_file_get_node_name (xml, s);
- if (! node_name) continue;
- #ifdef __DEBUG_ALL__
- printf("parse_album_xml: item[%d] = '%s'\n", i + 1, node_name);
- #endif
+ if (! node_name)
+ continue;
if (strcmp (node_name, "item") == 0) {
item->type = INDEX_ITEM_TYPE_PICTURE;
@@ -215,16 +207,6 @@ parse_album_xml (const gchar *filename, TAlbum *index)
}
xml_parser_close (xml);
-
- /* Print the items */
- #ifdef __DEBUG_ALL__
- printf ("ID = '%s'\ntitle = '%s'\ndescription = '%s'\n", index->ID, index->title, index->desc);
- for (i = 0; i < index->items->len; i++) {
- TIndexItem *item = g_ptr_array_index (index->items, i);
- printf ("item %d: path = '%s', title = '%s', title_description = '%s', thumbnail = '%s'\n",
- i, item->path, item->title, item->title_description, item->thumbnail);
- }
- #endif
return TRUE;
}
@@ -290,10 +272,6 @@ get_album_objects_count (const gchar *filename)
count = xml_file_node_get_children_count (xml, "/gallery/items/item");
xml_parser_close (xml);
-
- #ifdef __DEBUG_ALL__
- printf ("get_objects_count(%s) = %d\n", filename, count);
- #endif
return count;
}
diff --git a/src/job-manager.c b/src/job-manager.c
index 002ca06..64515b7 100644
--- a/src/job-manager.c
+++ b/src/job-manager.c
@@ -205,9 +205,6 @@ build_tree (TGallerySetup *setup,
printf ("Processing directory \"%s\"\n", src_tree);
stats_dirs_inc ();
- #ifdef __DEBUG_ALL__
- printf ("setup->real_templates_dir = %s\n", setup->real_templates_dir);
- #endif
/* Check access permissions */
if (access (src_tree, R_OK)) {
diff --git a/src/jpeg-utils.cpp b/src/jpeg-utils.cpp
index af7e4bf..10251e0 100644
--- a/src/jpeg-utils.cpp
+++ b/src/jpeg-utils.cpp
@@ -186,28 +186,6 @@ get_exif (const gchar *filename, TExifData **exif_data)
return -1;
}
-#ifdef __DEBUG_ALL__
- printf("EXIF_TAG_DATE_TIME = '%s'\n", data->datetime);
- printf("EXIF_TAG_MODEL = '%s'\n", data->camera_model);
- printf("EXIF_TAG_ISO_SPEED_RATINGS = '%s'\n", data->iso);
- printf("EXIF_TAG_FOCAL_LENGTH = '%s'\n", data->focal_length);
- printf("EXIF_TAG_FOCAL_LENGTH_IN_35MM_FILM = '%s'\n", data->focal_length_35mm);
- printf("EXIF_TAG_FNUMBER = '%s'\n", data->aperture);
- printf("EXIF_TAG_EXPOSURE_TIME = '%s'\n", data->exposure);
- printf("EXIF_TAG_FLASH = '%s'\n", data->flash);
- printf("Exif.Image.Software = '%s'\n", data->exif_software);
- printf("Exif.Image.ImageDescription = '%s'\n", data->exif_imgdesc);
- printf("Exif.Image.Artist = '%s'\n", data->exif_artist);
- printf("Exif.Image.Copyright = '%s'\n", data->exif_copyright);
- printf("Exif.Photo.UserComment = '%s'\n", data->exif_usercomment);
- printf("Iptc.Application2.ObjectName = '%s'\n", data->iptc_objectname);
- printf("Iptc.Application2.Copyright = '%s'\n", data->iptc_copyright);
- printf("Iptc.Application2.Credit = '%s'\n", data->iptc_credit);
- printf("Iptc.Application2.Caption = '%s'\n", data->iptc_caption);
- printf("Iptc.Application2.Byline = '%s'\n", data->iptc_author);
- printf("JPEG comment = '%s'\n", data->jpeg_comment);
-#endif
-
return 0;
}
diff --git a/src/setup.c b/src/setup.c
index 1081fa4..7f7caf9 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -164,32 +164,6 @@ parse_setup_xml (const gchar *filename, TGallerySetup *setup)
setup->favicon_type = xml_file_get_node_attribute (xml, "/gallery_setup/meta/favicon", "type");
xml_parser_close (xml);
-
- #ifdef __DEBUG_ALL__
- printf("setup: templates_path = '%s'\n", setup->templates_path);
- printf("setup: template_index = '%s'\n", setup->template_index);
- printf("setup: template_album = '%s'\n", setup->template_album);
- printf("setup: template_photo = '%s'\n", setup->template_photo);
- printf("setup: thumbnail_quality = %d\n", setup->thumbnail_quality);
- printf("setup: thumbnail_landscape_width = %ld\n", setup->thumbnail_landscape_width);
- printf("setup: thumbnail_landscape_height = %ld\n", setup->thumbnail_landscape_height);
- printf("setup: thumbnail_portrait_width = %ld\n", setup->thumbnail_portrait_width);
- printf("setup: thumbnail_portrait_height = %ld\n", setup->thumbnail_portrait_height);
- printf("setup: preview_quality = %d\n", setup->preview_quality);
- printf("setup: preview_landscape_width = %ld\n", setup->preview_landscape_width);
- printf("setup: preview_landscape_height = %ld\n", setup->preview_landscape_height);
- printf("setup: preview_portrait_width = %ld\n", setup->preview_portrait_width);
- printf("setup: preview_portrait_height = %ld\n", setup->preview_portrait_height);
- printf("setup: footer = '%s'\n", setup->footer);
- printf("setup: border_style = '%s'\n", setup->border_style);
- printf("setup: meta_author = '%s'\n", setup->meta_author);
- printf("setup: meta_description = '%s'\n", setup->meta_description);
- printf("setup: meta_keywords = '%s'\n", setup->meta_keywords);
- printf("setup: preload = %d\n", setup->preload);
- printf("setup: use_iptc_exif = %d\n", setup->use_iptc_exif);
- printf("setup: erase_exif_thumbnail = %d\n", setup->erase_exif_thumbnail);
- #endif
-
return TRUE;
}
@@ -225,28 +199,17 @@ find_templates_directory (TGallerySetup *setup)
gchar *base_dir;
gchar *pth;
- if (IS_DIR_SEP (*setup->templates_path))
- {
- #ifdef __DEBUG_ALL__
- printf("Warning: using absolute paths to templates\n");
- #endif
-
- if (! test_tmpl_files (setup->templates_path, setup))
- return g_strdup (setup->templates_path);
- }
- else
- {
- base_dir = g_path_get_dirname (setup->setup_xml_path);
- pth = g_strconcat (base_dir, "/", setup->templates_path, NULL);
- g_free (base_dir);
-
- #ifdef __DEBUG_ALL__
- printf("Warning: using relative paths to templates\n");
- #endif
-
- if (! test_tmpl_files (pth, setup))
- return pth;
- }
+ if (IS_DIR_SEP (*setup->templates_path)) {
+ if (! test_tmpl_files (setup->templates_path, setup))
+ return g_strdup (setup->templates_path);
+ } else {
+ base_dir = g_path_get_dirname (setup->setup_xml_path);
+ pth = g_strconcat (base_dir, "/", setup->templates_path, NULL);
+ g_free (base_dir);
+
+ if (! test_tmpl_files (pth, setup))
+ return pth;
+ }
log_error ("Couldn't find proper templates directory (tried '%s')\n", setup->templates_path);
return NULL;
diff --git a/src/xml-parser.c b/src/xml-parser.c
index 8c4301b..ee40dad 100644
--- a/src/xml-parser.c
+++ b/src/xml-parser.c
@@ -136,17 +136,9 @@ xml_file_get_node_value (TXMLFile *file, const gchar *x_path)
val = NULL;
if ((xpathObj->nodesetval) && (xpathObj->nodesetval->nodeNr > 0)) {
- #ifdef __DEBUG_ALL__
- printf("Result (%d nodes):\n", xpathObj->nodesetval->nodeNr);
- #endif
-
for (i = 0; i < xpathObj->nodesetval->nodeNr; i++)
{
cur = xpathObj->nodesetval->nodeTab[i];
- #ifdef __DEBUG_ALL__
- printf(" XPATH matched: element node \"%s[%d]\", value = '%s'\n", cur->name, i, cur->content);
- #endif
-
if (cur->content)
{
if (val == NULL)
@@ -191,17 +183,12 @@ xml_file_get_node_attribute (TXMLFile *file, const gchar *x_path, const gchar *a
attrv = NULL;
if ((xpathObj->nodesetval) && (xpathObj->nodesetval->nodeNr > 0)) {
- cur = xpathObj->nodesetval->nodeTab[0];
- attrvx = xmlGetProp (cur, (const xmlChar *) attr);
- if (attrvx) {
- attrv = g_strdup ((gchar*) attrvx);
- xmlFree (attrvx);
- }
-
- #ifdef __DEBUG_ALL__
- printf("Result (%d nodes):\n", xpathObj->nodesetval->nodeNr);
- printf(" XPATH matched: element node \"%s\", value = '%s', property value = '%s'\n", cur->name, cur->content, attrv);
- #endif
+ cur = xpathObj->nodesetval->nodeTab[0];
+ attrvx = xmlGetProp (cur, (const xmlChar *) attr);
+ if (attrvx) {
+ attrv = g_strdup ((gchar*) attrvx);
+ xmlFree (attrvx);
+ }
}
xmlXPathFreeObject (xpathObj);