- Issue created by @alex.skrypnyk
We need a default fallback image style to protect a website from users uploading large image files and having those files rendered to the end-users.
1. Create a `Page` content and upload a 50 MB image to all image fields.
2. Save the page and observe that Banner image (and other images) are shown using their original file (and size).
Add a default `fallback` image style that will be applied to all images that do not specify a custom image style explicitly.
The pre-processing for images currently takes place within `civictheme_media_image_get_variables()` function. This function accepts an `$image_style` parameter which is currently set to `NULL`. The proposal is to create a `civictheme_fallback` image style with some sensible defaults (downscale to 1500x1500, preserving ratio) and set this as a default value for the `$image_style` parameter. This will ensure that all images pre-processed via CivicTheme's functions will be downsized.
Note that consumer sites can always update the proposed default values of the `fallback` image style as they see fit.
1. Decide on the image style name. Proposal `civictheme_fallback`.
2. Decide on the default values. Proposal is `1500x1500`
3. Add image style
4. Add image style name to the `civictheme_media_image_get_variables()` function as a default value for the second argument.
5. Add tests that assert the present of the `styles` substring in the rendered output of, say, Banner featured image source URL.
None
None
None
Active
1.11
Code