From: Mischa POSLAWSKY Date: Thu, 5 Oct 2017 20:03:55 +0000 (+0200) Subject: thumb: dynamic image relay with resize option X-Git-Tag: v3.2~15 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/a0fbf3931f22b677a5045fb2392f6fa9714ca478 thumb: dynamic image relay with resize option Generate image with requested height from data source, which should be bypassed by the server if target file exists. Copied from Lijtweg at commit v2.5-58-gac5434f0af (2017-12-12). --- diff --git a/thumb/.gitignore b/thumb/.gitignore new file mode 100644 index 0000000..34bbc9f --- /dev/null +++ b/thumb/.gitignore @@ -0,0 +1 @@ +/[1-9]*/ diff --git a/thumb/.htaccess b/thumb/.htaccess new file mode 100644 index 0000000..c63c79e --- /dev/null +++ b/thumb/.htaccess @@ -0,0 +1,3 @@ + + Header set Cache-Control "max-age=2628000, immutable" + diff --git a/thumb/index.php b/thumb/index.php new file mode 100644 index 0000000..b49ca6e --- /dev/null +++ b/thumb/index.php @@ -0,0 +1,34 @@ +&1"); + if ($return) { + http_response_code(500); + trigger_error("thumbnail creation failed: $return", E_USER_WARNING); + exit; + } +} + +header('Content-type: '.mime_content_type($target)); +readfile($target); +exit;