summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2014-09-15 00:40:22 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2014-09-15 00:40:22 +0200
commitd45c36f28e6d0a720df861c5497b4fe022d385b0 (patch)
treed4e94633a39589df40fdcb1f005678fdc7f05282
parentefa3be408a2420f177c2e7cf798f92f3efdad36b (diff)
downloadcataract-d45c36f28e6d0a720df861c5497b4fe022d385b0.tar.xz
theming: Define meaning of the <no_resize> tag
Although probably not very common scenario, let's be consistent across all defined image sizes and clearly state that an explicitly supplied image file for an optional image size should carry the tag in order not to get resized.
-rw-r--r--src/generators.c2
-rw-r--r--templates/default.xml6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/generators.c b/src/generators.c
index 2483175..a2f7a65 100644
--- a/src/generators.c
+++ b/src/generators.c
@@ -230,7 +230,7 @@ generate_image (TGallerySetup *setup,
res = res || needs_update (img_src, img_dst);
if (! query_update) {
/* Copy the source file */
- if ((is_preview && item->preview) || (is_original && image_size->no_resize)) {
+ if (image_size->no_resize && ((is_preview && item->preview) || is_original)) {
if (! copy_file (img_src, img_dst))
log_error (" Error copying image %s to %s\n", img_src, img_dst);
}
diff --git a/templates/default.xml b/templates/default.xml
index d2b0b63..318531c 100644
--- a/templates/default.xml
+++ b/templates/default.xml
@@ -34,6 +34,12 @@
<landscape w="1067" h="600" />
<portrait w="800" h="800" />
<quality value="95" />
+ <!-- Similar to the "original" size where the image has to be always supplied,
+ the image won't get resized only when an image file is supplied by the
+ <item preview="..."> tag. Otherwise this tag is ignored and image will
+ be resized from the "original" size (backwards compatibility).
+ This rule applies also for any other optional image sizes. -->
+ <no_resize />
</size>
<!-- Thumbnail section is mandatory. -->