You are here

function image_style_warmer_crop_update in Image Style Warmer 8

Implements hook_ENTITY_update() for crop entity.

File

./image_style_warmer.module, line 64
ISW Module file creates image styles on image upload and via queue.

Code

function image_style_warmer_crop_update(EntityInterface $entity) {
  if ($entity
    ->get('entity_type')->value == 'file') {
    if ($file = File::load($entity
      ->get('entity_id')->value)) {
      \Drupal::service('image_style_warmer.warmer')
        ->warmUp($file);
    }
  }
}