| | 311 | |
| | 312 | /** |
| | 313 | * Output the image to the browser. |
| | 314 | * |
| | 315 | * @throws Kohana_Exception |
| | 316 | * @return object |
| | 317 | */ |
| | 318 | public function output() |
| | 319 | { |
| | 320 | $new_image = $this->image['file']; |
| | 321 | |
| | 322 | // Separate the directory and filename |
| | 323 | $dir = pathinfo($new_image, PATHINFO_DIRNAME); |
| | 324 | $file = pathinfo($new_image, PATHINFO_BASENAME); |
| | 325 | |
| | 326 | // Normalize the path |
| | 327 | $dir = str_replace('\\', '/', realpath($dir)).'/'; |
| | 328 | |
| | 329 | // Process the image with the driver |
| | 330 | $status = $this->driver->process($this->image, $this->actions, $dir, $file, $output = TRUE); |
| | 331 | |
| | 332 | // Reset the actions |
| | 333 | $this->actions = array(); |
| | 334 | |
| | 335 | return $status; |
| | 336 | } |