thumb: ?backend option to override resize callback
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 5 Jul 2018 13:29:41 +0000 (15:29 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 7 Jul 2018 11:42:39 +0000 (13:42 +0200)
Prepare to implement and test different mkthumb options.

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)