You are here

function imagefield_filefield_paths_process_file in File (Field) Paths 6

Implements hook_filefield_paths_process_file().

File

modules/imagefield.inc, line 10
Provides ImageField module specific functions for FileField Paths.

Code

function imagefield_filefield_paths_process_file($new, $file, $settings, $node, $update) {
  if ($new) {

    // Delete ImageField thumbnail.
    if (isset($file['widget']) && $file['widget'] == 'imagefield' && file_exists($thumbnail_source = imagefield_file_admin_thumb_path(array(
      'filepath' => $file['filepath']['old'],
    )))) {
      file_delete($thumbnail_source);
    }
  }
}