From 923c421b3cbb2d6b55f40595034a12c19fef7c1b Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sat, 17 Sep 2016 12:07:40 +0200 Subject: 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 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. --- src/setup.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/setup.c') 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 */ -- cgit v1.2.3