summaryrefslogtreecommitdiff
path: root/templates/default.xml
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2015-01-25 18:23:03 +0100
committerTomas Bzatek <tbzatek@users.sourceforge.net>2015-01-25 18:23:03 +0100
commit6fffe1a21d5acaa544f7796241e13ff37e75349f (patch)
tree83e0cf3237f11742a89fbc925ac327595b930068 /templates/default.xml
parent7779510229bb478f591cc67c0cb0e2fbb84fdb98 (diff)
downloadcataract-6fffe1a21d5acaa544f7796241e13ff37e75349f.tar.xz
theming: Make custom image size handling fully flexible
This commit brings full flexibility of custom image size definition and usage. When a custom image size is defined, it automatically maps to the album <item> tag arguments. Alternatively, this automatic name matching can be overriden by <size tagname="..."> theme setup tags. This allows us to supply image of different sizes that can be also used in templates. Legacy behaviour of "fullsize" and "preview" image size fallback is retained (though not recommended in new theming setups).
Diffstat (limited to 'templates/default.xml')
-rw-r--r--templates/default.xml14
1 files changed, 8 insertions, 6 deletions
diff --git a/templates/default.xml b/templates/default.xml
index 3948538..2ac8354 100644
--- a/templates/default.xml
+++ b/templates/default.xml
@@ -3,6 +3,11 @@
<!-- image size definitions -->
<image_sizes>
+ <!-- Every image size automatically corresponds to the <item> tag parameter
+ of the same name in album source files. E.g. image size named "hires"
+ would correspond to <item hires=".."> tags. Use the image size parameter
+ "tagname" to override that. -->
+
<!-- "original", "preview" and "thumbnail" sizes are somewhat special here
in order to keep compatibility with previous versions. In case when
"original" size is not available due to <nofullsize> tag present,
@@ -26,9 +31,7 @@
<!-- The "preview" size is considered default and should be displayed
on a first visit. -->
- <!-- Corresponds with optional <item preview="..."> tag in album source file.
- No resizing is made when the attribute is present (legacy behaviour). -->
- <size name="preview">
+ <size name="preview" tagname="preview">
<!-- Note that "preview" sizes can be further overriden by album legacy
<images> tag and also per-image by "width"/"height" <item> tag
attributes. Same goes for quality. -->
@@ -44,16 +47,15 @@
</size>
<!-- Thumbnail section is mandatory. -->
- <!-- Corresponds with optional <item thumbnail> tag in album source file.
- Note that thumbnail images are always resized even for custom supplied files. -->
<!-- The "type" attribute has to be set to "thumbnail" to be treated as such. -->
+ <!-- Note that thumbnail images are always resized even for custom supplied files. -->
<!-- An optional "style" attribute affects cropping:
* normal - image is resized to fit the dimension limits, maintaining
aspect ratio without any crop (default)
* squared - image is cropped to a squared size and resized to fit
* fixed - image is cropped to a specified dimension and cropped to
fit the specified aspect ratio
- An optional album item <thumbnail crop> tags may affect crop area. -->
+ An optional album item <thumbnail crop> tags may affect the crop area. -->
<size name="thumbnail" type="thumbnail" style="normal">
<landscape w="180" h="120" />
<portrait w="120" h="180" />