You are here

function focal_point_parse in Focal Point 7

Parse the string representation of the focal point into an array.

Parameters

string $focal_point: The focal point string to be parsed.

Return value

array The x & y offsets (in percents) from the top left corner of the image.

2 calls to focal_point_parse()
focalPointTest::testFocalPoint in test/FocalPointTest.php
Test Focal Point.
focal_point_effect_crop_data in ./focal_point.effects.inc
Compile the necessary data for the image crop effect.

File

./focal_point.module, line 467

Code

function focal_point_parse($focal_point = '') {
  if (empty($focal_point)) {
    $focal_point = FOCAL_POINT_DEFAULT;
  }
  return array_combine(array(
    'x-offset',
    'y-offset',
  ), explode(',', $focal_point));
}