Regenerating Imagestyle Content

Submitted by Tom Thorp on Monday, November 28, 2016 - 14:12
Modified on Friday, July 5, 2019 - 23:04
Drupal 8 Logo
I noticed whilst doing administration work on my Drupal 8 site, that not all my imagestyles were getting populated after each change. As content in imagestyles get created on first-time access, this presents an issue with respect to metatags, as metatag content has to be accessible for website crawlers to access it. 
Fortunately there is an easy way around this.

Views To The Rescue

Instead of going into each content that contains an image, create a View of the same image with different imagestyles.
View of images
 Then for each image, go into the property and edit the imagestyle to be used.
Image properties
Do this for each image / imagestyle combination that needs to be generated. Run the View either within Views or an admin page you've set up for that purpose.
Obviously regenerating imagestyles can take a hit on server resources, particularly if there are a lot of images to be generated. Therefore it is best to run this procedure at a quiet time, or when your Drupal server is in maintenance mode. 

About the author

Tom Thorp
Tom Thorp is an IT Consultant living in Miami on Queensland's Gold Coast. With over 30+ years working in the IT industry, Tom's experience is a broad canvas. The IT services Tom provides to his clients, includes :
Website development and hosting
Database Administration
Server Administration (Windows, Linux, Apple)
PABX Hosting and Administration
Helpdesk Support (end-user & technical).