You are here

public function ImageStylesWarmer::warmUp in Image Style Warmer 8

Init warm up with configured image styles for an image file.

Parameters

\Drupal\file\FileInterface $file: The file for which image styles should be created.

Overrides ImageStylesWarmerInterface::warmUp

File

src/ImageStylesWarmer.php, line 79

Class

ImageStylesWarmer
Defines an images styles warmer.

Namespace

Drupal\image_style_warmer

Code

public function warmUp(FileInterface $file) {
  $initialImageStyles = $this->config
    ->get('initial_image_styles');
  if (!empty($initialImageStyles)) {
    $this
      ->doWarmUp($file, array_keys($initialImageStyles));
  }
  $queueImageStyles = $this->config
    ->get('queue_image_styles');
  if (!empty($queueImageStyles)) {
    $this
      ->addQueue($file, array_keys($queueImageStyles));
  }
}