if (!file_exists($imgpath)) {
http_response_code(404);
- exit;
+ $imgpath = '404.png';
+ if (!file_exists($imgpath)) {
+ exit;
+ }
}
$target = "thumb/$height/$imgpath";
function mkthumb($source, $target, $width, $height)
{
+ if (isset($_GET['backend'])) {
+ $backend = $_GET['backend'];
+ }
+ else {
+ $backend = 'exec';
+ }
+ $backend = "mkthumb_$backend";
+
@mkdir(dirname($target), 0777, TRUE);
- return mkthumb_exec($source, $target, $width, $height);
+ $backend($source, $target, $width, $height);
}
function mkthumb_exec($source, $target, $width, $height)