thumb: ?backend option to override resize callback
[minimedit.git] / thumb / index.php
index f7c36d9d0a6d776bde1a4ff3008b2f401958e770..066e88d7cf9561227d96f8b6a2fe9ff80afacc21 100644 (file)
@@ -38,8 +38,16 @@ exit;
 
 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)