You are here

function imagick_percent_filter in Imagick 7

1 call to imagick_percent_filter()
_imagick_definecanvas_get_dimensions in effects/imagick.definecanvas.inc
Helper function to calculate new width, height, x and y coordinates

File

effects/imagick.definecanvas.inc, line 208

Code

function imagick_percent_filter($length_specification, $current_length) {
  if (strpos($length_specification, '%') !== FALSE) {
    $length_specification = $current_length !== NULL ? str_replace('%', '', $length_specification) * 0.01 * $current_length : NULL;
  }
  return $length_specification;
}