X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/e93a4651a5cc2ccc55964b419b4f57c9dd472520..e15f27487946afb29f3f846dd96edd1fb65e3f44:/thumb/index.php diff --git a/thumb/index.php b/thumb/index.php index d662b5f..2a8e303 100644 --- a/thumb/index.php +++ b/thumb/index.php @@ -1,8 +1,7 @@ getCode() ?: 500); @@ -33,9 +32,21 @@ header('Content-type: '.mime_content_type($target)); readfile($target); exit; -function mkthumb($source, $width, $height) +function mkthumb($source, $size) { - $target = "thumb/$height/$source"; + if (strpos($size, 'x') !== FALSE) { + list ($width, $height) = explode('x', $size); + if (empty($height)) { + $height = $width * 4; + } + } + else { + $height = $size; + } + if (empty($width)) { + $width = $height * 4; + } + $target = "thumb/$size/$source"; if (isset($_GET['backend'])) { $backend = $_GET['backend'];