summaryrefslogtreecommitdiff
path: root/templates/fluid/fluid.xml
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2016-10-02 16:58:27 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2016-10-02 17:32:43 +0200
commitddd9556689af055355a07cf2766fe95eaed4e38e (patch)
treeb6de3e57a5cfbd0d855277c3b8c93f16549f0bf2 /templates/fluid/fluid.xml
parent56ff7bc45505b3e39b2f9be70e7bee3f80ec4f70 (diff)
downloadcataract-ddd9556689af055355a07cf2766fe95eaed4e38e.tar.xz
Add support for HiDPI images
This works by creating corresponding hidpi image sizes on startup and letting the machinery generate high resolution images from the source images (no way to use supplied images). However since browsers expect exact image dimension multiples for the particular scale factor, a reference image size (scale factor 1.0x) must be read first, then cropped to match reference aspect ratio and resized to exact dimensions. That way pixel-perfect results can be achieved for the chosen scale factor. TODO: the CSS background-image: image-set() tags are not supported on Firefox. TODO: try the 1.5x scale factor
Diffstat (limited to 'templates/fluid/fluid.xml')
-rw-r--r--templates/fluid/fluid.xml26
1 files changed, 24 insertions, 2 deletions
diff --git a/templates/fluid/fluid.xml b/templates/fluid/fluid.xml
index 376d56d..ff4baee 100644
--- a/templates/fluid/fluid.xml
+++ b/templates/fluid/fluid.xml
@@ -31,6 +31,26 @@
</size>
</image_sizes>
+ <!-- Global HiDPI settings -->
+ <!-- For each defined image size new HiDPI image sizes will be generated
+ automatically. Means the resulting HiDPI image files will have their own
+ subdirectory and all existing template macros are available as well.
+ The resulting image size name will be of format "SIZE_NAME_HIDPI_1.5X"
+ where SIZE_NAME is name of the reference image size and "1.5X" is the
+ particular size factor. -->
+ <hidpi enabled="yes">
+ <!-- Specify requested size factors, separated by comma (typically '2x'
+ or '1.5x, 2x'). -->
+ <sizes>2x</sizes>
+ <!-- Optionally allow upscaling. Represents a percentage how much smaller
+ image can still be used for upscaling. Set to 0 to disable upscaling
+ completely. -->
+ <threshold upscale="33" />
+ <!-- Compression artifacts may be less noticeable since the actual pixel
+ pitch is smaller. Lower the compression quality to save bandwidth. -->
+ <quality value="90" thumbnail="60" />
+ </hidpi>
+
<resize>
<!-- Use this section to tweak resizing methods. For the moment ImageMagick
is the only supported method, being used from the beginning of the project,
@@ -42,8 +62,10 @@
arguments defining target dimensions. For the rest of arguments
standard convert(1) command syntax is used. -->
<!-- In case an option string is empty, internal defaults are used. -->
- <resize_options>-set option:filter:blur 0.6 -filter Gaussian -thumbnail ${WIDTH}x${HEIGHT}</resize_options>
- <thumbnail_options>-set option:filter:blur 0.6 -filter Gaussian -thumbnail ${WIDTH}x${HEIGHT}</thumbnail_options>
+ <!-- Please see http://www.imagemagick.org/Usage/resize/#resize for resize
+ modifiers (e.g. we use the '!' flag to correct off-by-one errors). -->
+ <resize_options>-set option:filter:blur 0.6 -filter Gaussian -resize ${WIDTH}x${HEIGHT}!</resize_options>
+ <thumbnail_options>-set option:filter:blur 0.6 -filter Gaussian -thumbnail ${WIDTH}x${HEIGHT}!</thumbnail_options>
</ImageMagick>
</resize>