For each image in a library, you can generate thumbnails with different sizes and then choose which size to display on the website. For example, you can have an image with original size 400x400 px uploaded in a library. You can generate one thumbnail 200x200 px and another 100x100 px. On one page you can display the small thumbnail and on another – the larger, and whenever the image is clicked, you can display the original size.
Additionally, you can resolve the thumbnail URLs in your code and load a thumbnail instead of the actual image for use case scenarios where this behavior is desired. For more information see Retrieve media content thumbnail URLs
You first set the predefined thumbnail sizes, then for each root library you choose what type of thumbnails to generate, and, finally, when configuring the widgets, you choose which thumbnails to display.
To configure the image thumbnail sizes, perform the following:
- In the main menu, click Administration » Settings.
The Basic settings page appears.
- Click Global settings » Thumbnails.
All defined Image thumbnails appear.
For each thumbnail size, you can see its size and how many libraries it is applied to.
- To create a new thumbnail size, click Add image thumbnail size.
- Enter a name for the thumbnail size.
- In Resize image thumbnail dropdown box, you can choose whether you want to crop or resize the images in the library to fit the predefined size.
Select one of the following:
- Resize to fit area
Enter in pixels the dimensions of the predefined thumbnail, by filling out Max width and Max height input fields.
When the proportion of the original image dimensions is different from this of the predefined thumbnail, the images are resized so that the longer side of the image fits the respective side of the thumbnail. Images are aligned up and to the left of the predefined thumbnail.
- Crop to area
Enter the dimensions of the cropped area in Width and Height fields.
The original image is cropped from all sides evenly, so that it fits the thumbnail size.
- If you want original images that are smaller than the predefined thumbnail to be resized to fit the thumbnail, select Resize smaller images to bigger dimensions checkbox.
- Choose the Quality of the image thumbnail that you want to generate.
- If you want to use this thumbnail size as a default when you create an image library, select When creating an image library select this size by default checkbox.
- Click Done.
You can select more than one thumbnail size as a default.
- If required, enter a name for developer that will be used in code and for generating the URL of the thumbnail.
The name must be unique.
Add thumbnail profiles styles to your theme
In case you are not using the Basic theme but still want to leverage thumbnail profiles styles, you need to add manually the CSS to your custom theme file. The following example demonstrates how you add styling to a custom theme:
Limit the visibility of thumbnail profiles
You can choose which thumbnails to hide or display in specific widgets. For example, when you configure the Image widget, you can have different choices of thumbnail sizes from the choices you have when you configure the Image gallery widgets.
To do this, you use thumbnail tags. You tag thumbnail profiles then you tag widgets where you want these thumbnails to be available with the same tags.
For more information, see Limit the visibility of thumbnail profiles.