function image_path_flush

Clear cached versions of a specific file in all styles.

Parameters

$path: The Drupal file path to the original image.

2 calls to image_path_flush()
image_file_move in drupal/core/modules/image/image.module
Implements hook_file_move().
image_file_predelete in drupal/core/modules/image/image.module
Implements hook_file_predelete().

File

drupal/core/modules/image/image.module, line 493
Exposes global functionality for creating image styles.

Code

function image_path_flush($path) {
  $styles = entity_load_multiple('image_style');
  foreach ($styles as $style) {
    $image_path = image_style_path($style
      ->id(), $path);
    if (file_exists($image_path)) {
      file_unmanaged_delete($image_path);
    }
  }
}