summaryrefslogtreecommitdiff
path: root/src/setup.c
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2016-09-17 12:07:40 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2016-09-17 12:07:40 +0200
commit923c421b3cbb2d6b55f40595034a12c19fef7c1b (patch)
treec907c5189390ba8b38d1c453bb7db44b2c943ed7 /src/setup.c
parent6a16a08ea3e75a524cb136f4c6ada1e4eef4bfd4 (diff)
downloadcataract-923c421b3cbb2d6b55f40595034a12c19fef7c1b.tar.xz
Drop legacy nofullsize and album width/height/quality tags
This drops the legacy functionality that doesn't really fit into the new flexible design concept and makes code unnecessarily complicated. Most of these overrides affected only the "preview" image size anyway. This also makes the <item src> attribute mandatory as it's being the only source of metadata (unless overriden or supplied externally). This unfortunately breaks the so-far 100% album XML files compatibility.
Diffstat (limited to 'src/setup.c')
-rw-r--r--src/setup.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/setup.c b/src/setup.c
index 37a5382..3d1ff2e 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -102,7 +102,6 @@ parse_setup_xml (const gchar *filename)
setup->erase_exif_thumbnail = xml_file_get_node_attribute_boolean_with_default (xml, "/gallery_setup/images/erase_embed_thumbnail", "value", FALSE);
setup->strip_xmp = xml_file_get_node_attribute_boolean_with_default (xml, "/gallery_setup/images/strip_xmp", "value", TRUE);
setup->write_supplied_exif = xml_file_get_node_attribute_boolean_with_default (xml, "/gallery_setup/images/write_supplied_exif", "value", FALSE);
- setup->nofullsize = xml_file_get_node_present (xml, "/gallery_setup/images/nofullsize");
setup->autorotate = xml_file_get_node_attribute_boolean_with_default (xml, "/gallery_setup/images/autorotate", "value", TRUE);
/* meta section */
@@ -144,6 +143,18 @@ parse_setup_xml (const gchar *filename)
}
+/* Dummy image size sort func */
+static gint
+image_sizes_compare_func (TImageSize *a, TImageSize *b)
+{
+ int sa, sb;
+
+ sa = a->landscape_width + a->landscape_height + a->portrait_width + a->portrait_height + a->square_size;
+ sb = b->landscape_width + b->landscape_height + b->portrait_width + b->portrait_height + b->square_size;
+
+ return sb - sa;
+}
+
/*
* parse_design_setup_xml: XML parser for design.xml file
*/
@@ -238,6 +249,7 @@ parse_design_setup_xml (const gchar *filename)
image_size->fallback_size = xml_file_get_node_attribute (xml, s, "size");
g_free (s);
}
+ design->image_sizes = g_list_sort (design->image_sizes, (GCompareFunc) image_sizes_compare_func);
/* theme section */