combined_image_style
Started off as a module for developers who need the combined output of multiple image styles. It serves as a drop-in replacement of the core image style handling and both systems just keep working. It combines the image style machine names for folder structure and itok tokens for security.
E.g. you have image styles "portrait", "square" and "landscape" which will crop an image into the desired shape. Now you want to generate, for each of the previously mentioned, images to "thumbnail", "medium" and "large" sizes. In this simple example you can reduce the amount of images styles from 9 to 6.
Return a render array:
(new CombinedImageStyle())
->setSourceUri($uri)
->setImageStyles(['square', 'thumbnail'])
->toImage();
return the image style URI.
(new CombinedImageStyle())
->setSourceUri($uri)
->setImageStyles(['square', 'medium'])
->buildCombinedUri();
Generate the derivative and return the image style URI.
(new CombinedImageStyle())
->setSourceUri($uri)
->setImageStyles(['square', 'large'])
->buildCombinedUri(TRUE);
The module now also has a submodule with a couple of really basic field formatters for image and media (entity reference) fields. Other modules that work with this module: