h5ai-flpsite/src/h5ai/php/thumb.php
2011-09-04 21:18:19 +02:00

26 lines
602 B
PHP

<?php
require_once "thumbnail.php";
$src = $_REQUEST["src"];
$width = $_REQUEST["width"];
$height = $_REQUEST["height"];
$mode = $_REQUEST["mode"];
if (!Thumbnail::isUsable()) {
Image::showImage($src);
exit;
}
$thumbnail = new Thumbnail($src, $mode, $width, $height);
$thumbnail->create(1);
if (file_exists($thumbnail->getPath())) {
Image::showImage($thumbnail->getPath());
} else {
$image = new Image();
$image->setSource($src);
$image->thumb($mode, $width, $height);
$image->showDest();
}
?>