You are here

function imagefield_crop_file_insert in Imagefield Crop 6

@file hook_file and imagefield_crop file functions.

File

./imagefield_crop_file.inc, line 7
hook_file and imagefield_crop file functions.

Code

function imagefield_crop_file_insert($file) {

  // we copy the file as is, for quality cropping.
  if (isset($file->field['widget']) && $file->field['widget']['module'] == 'imagefield_crop' && imagefield_file_is_image($file)) {
    $newfile = drupal_clone($file);
    file_copy($newfile->filepath, imagefield_crop_file_admin_crop_display_path($newfile));
  }
}