<?php
* QThumbService.php
*
* @author
* @version
* QThumbService.php class
*
* Uses Thumbnail class by Ian Selby
* Check http://www.gen-x-design.com/demos/thumbnailer/
*
* Place <service id="thumb" class="QThumbService"></service> in application.xml to use.
* Demo: http://localhost/?thumb=themes/Basic/some_cool_picture&height=0&width=400
* Demo: $this->getRequest()->constructUrl('thumb', 'themes/Basic/some_cool_picture.png', array('height' => 0, 'width => 350))
*
* Properties
* -
*
* @author
* @version
*
* Modifications:
class QThumbService extends TService{
* Runs the service.
public function run(){
include_once('thumbnail.inc.php');
$file = null;
$file= $this->getRequest()->getServiceParameter();
if ($file && isset($_GET['width']) && isset($_GET['height'])){
$thumb = new Thumbnail($file);
$thumb->resize($_GET['width'],$_GET['height']);
$thumb->show();
exit;
}
else
throw new THttpException(404,'thumbservice_file_invalid_or_height_or_width_not_set',$fileKey);
}
}
?>