You are here

function imce_create_thumbnail in IMCE 6.2

Same name and namespace in other branches
  1. 6 inc/page.inc \imce_create_thumbnail()
  2. 7 inc/imce.page.inc \imce_create_thumbnail()

Create a thumbnail.

1 call to imce_create_thumbnail()
imce_create_thumbnails in inc/imce.page.inc
Create all selected thumbnails.

File

inc/imce.page.inc, line 461
Implements the file browser.

Code

function imce_create_thumbnail($filename, &$imce, $thumbnail) {

  //generate thumbnail name
  $name = $thumbnail['prefix'];
  if ($thumbnail['suffix'] != '' && ($dot = strrpos($filename, '.'))) {
    $name .= substr($filename, 0, $dot);
    $name .= $thumbnail['suffix'];
    $name .= substr($filename, $dot);
  }
  else {
    $name .= $filename;
  }

  //scale the image
  list($width, $height) = explode('x', $thumbnail['dimensions']);
  return imce_resize_image($filename, $imce, $width, $height, TRUE, $name, variable_get('imce_settings_thumb_method', 'scale_and_crop'));
}