You are here

function imagefield_file_admin_thumb_path in ImageField 6.3

Given a file, return the path the image thumbnail used while editing.

2 calls to imagefield_file_admin_thumb_path()
imagefield_file_delete in ./imagefield_file.inc
Implementation of hook_file_delete().
theme_imagefield_admin_thumbnail in ./imagefield.module

File

./imagefield_file.inc, line 61
hook_file and imagefield file functions.

Code

function imagefield_file_admin_thumb_path($file, $create_thumb = TRUE) {
  $file = (object) $file;
  $short_path = preg_replace('/^' . preg_quote(file_directory_path(), '/') . '/', '', $file->filepath);
  $filepath = file_directory_path() . '/imagefield_thumbs' . $short_path;
  if ($create_thumb) {
    imagefield_create_admin_thumb($file->filepath, $filepath);
  }
  return $filepath;
}