function image_post_update_scale_and_crop_effect_add_anchor

Add 'anchor' setting to 'Scale and crop' effects.

File

core/modules/image/image.post_update.php, line 28

Code

function image_post_update_scale_and_crop_effect_add_anchor(&$sandbox = NULL) {
  \Drupal::classResolver(ConfigEntityUpdater::class)->update($sandbox, 'image_style', function ($image_style) {
    /** @var \Drupal\image\ImageStyleInterface $image_style */
    $effects = $image_style->getEffects();
    foreach ($effects as $effect) {
      if ($effect->getPluginId() === 'image_scale_and_crop') {
        return TRUE;
      }
    }
    return FALSE;
  });
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.