protected function resize($args)
{
$target = $args['target'];
$width = $args['width'];
$height = $args['height'];
$x = (int) $args['x'];
$y = (int) $args['y'];
$mode = $args['mode'];
$bg = null;
$degree = (int) $args['degree'];
if (($volume = $this->volume($target)) == false || ($file = $volume->file($target)) == false) {
return array('error' => $this->error(self::ERROR_RESIZE, '#' . $target, self::ERROR_FILE_NOT_FOUND));
}
return ($file = $volume->resize($target, $width, $height, $x, $y, $mode, $bg, $degree)) ? array('changed' => array($file)) : array('error' => $this->error(self::ERROR_RESIZE, $volume->path($target), $volume->error()));
}