public function destination()
{
if (is_callable($this->options['destination'])) {
return call($this->options['destination'], $this);
} else {
$destination = new Obj();
$safeName = f::safeName($this->source->name());
$destination->filename = str::template($this->options['filename'], array('extension' => $this->source->extension(), 'name' => $this->source->name(), 'filename' => $this->source->filename(), 'safeName' => $safeName, 'safeFilename' => $safeName . '.' . $this->extension(), 'width' => $this->options['width'], 'height' => $this->options['height'], 'hash' => md5($this->source->root() . $this->settingsIdentifier())));
$destination->url = $this->options['url'] . '/' . $destination->filename;
$destination->root = $this->options['root'] . DS . $destination->filename;
return $destination;
}
}