You are here

function theme_focal_point_image_style in Focal Point 7

Replacement for the standard theme_image_style function.

This function appends an fid and focal_point to the image URL.

Parameters

array $variables: This expects the same attributes as theme_image_style with the following one addition:

  • focal_point.

Return value

string The rendered HTML of the image in question.

See also

theme_image_style()

1 theme call to theme_focal_point_image_style()
_focal_point_preview in ./focal_point.module
Allows previewing of derivitive images based on the given focal point.

File

./focal_point.theme.inc, line 23
Theme functions defined by focal_point.

Code

function theme_focal_point_image_style($variables) {

  // Determine the dimensions of the styled image.
  $dimensions = array(
    'width' => $variables['width'],
    'height' => $variables['height'],
  );
  image_style_transform_dimensions($variables['style_name'], $dimensions);
  $variables['width'] = $dimensions['width'];
  $variables['height'] = $dimensions['height'];

  // Determine the URL for the styled image.
  $url = image_style_url($variables['style_name'], $variables['path']);
  $delimiter = strpos($url, '?') !== FALSE ? '&' : '?';
  $variables['path'] = $url . $delimiter . 'focal_point=' . $variables['focal_point'];
  return theme('image', $variables);
}