Generated image styles are never invalidated/deleted

Created on 16 October 2023, over 1 year ago
Updated 10 April 2024, 12 months ago

Problem/Motivation

In certain cases, the generated image styles should be regenerated to account for changes in settings.

Proposed resolution

  • Delete all generated image styles if any of the following situations occur:
    • The settings config entity is updated
    • The image_widget_crop, automated_crop or focal_point modules are (un)installed
    • The drimage module is uninstalled
    • The imageapi_optimize_webp module is installed and the option is changed
    • The imageapi_optimize_webp module is installed and the default pipeline entity is updated
  • Delete generated image styles for a certain crop type if that crop type entity is updated.
  • Remove the following notices from the settings page:
    • You will need to delete all drimage styles using image_widget_crop after enabling this
    • You might need to flush the image cache (drush if) after enabling this option.
  • Since we're adding this code, we might as well add a Drush command to allow users to do it manually, eg. in case a custom hook_drimage_image_style_alter hook is added to the project.
🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇧🇪Belgium dieterholvoet Brussels

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024