When an image is updated (replace file, or edit focal point) and triggers an image style flush, the dynamic derivatives generated by this module should be deleted.
Attached patch adds a hook_image_style_flush() to remove the generated derivatives. NB requires a core patch to pass the image path to the hook ( https://www.drupal.org/project/drupal/issues/2833129 🐛 hook_image_style_flush doesn't get the $path passed to Drupal\image\Entity\ImageStyle::flush() method Fixed ).
The regex pattern to target only derivatives generated by this module (any image styles with a '[' in the path) wasn't working with FileSystem::scanDirectory() - so all derivatives for the given image are deleted (even those generated by core's image styles).
Needs review
1.0
Code