git.shiar.nl
/
minimedit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9a24b86
)
thumb: decide on cache location in mkthumb()
author
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 7 Jul 2018 11:28:08 +0000
(13:28 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 7 Jul 2018 11:42:39 +0000
(13:42 +0200)
thumb/index.php
patch
|
blob
|
history
diff --git
a/thumb/index.php
b/thumb/index.php
index 1267919810daf320bbb9e00b9b9e2afd66d5674d..2849bb50d59f689bfdc927a34ae0b1eb04938f34 100644
(file)
--- a/
thumb/index.php
+++ b/
thumb/index.php
@@
-13,9
+13,8
@@
if (!file_exists($imgpath)) {
}
}
}
}
-$target = "thumb/$height/$imgpath";
try {
try {
-
mkthumb($imgpath, $target
, $width, $height);
+
$target = mkthumb($imgpath
, $width, $height);
}
catch (Exception $e) {
http_response_code($e->getCode() ?: 500);
}
catch (Exception $e) {
http_response_code($e->getCode() ?: 500);
@@
-34,8
+33,10
@@
header('Content-type: '.mime_content_type($target));
readfile($target);
exit;
readfile($target);
exit;
-function mkthumb($source, $
target, $
width, $height)
+function mkthumb($source, $width, $height)
{
{
+ $target = "thumb/$height/$source";
+
if (isset($_GET['backend'])) {
$backend = $_GET['backend'];
}
if (isset($_GET['backend'])) {
$backend = $_GET['backend'];
}
@@
-49,6
+50,7
@@
function mkthumb($source, $target, $width, $height)
@mkdir(dirname($target), 0777, TRUE);
$backend($source, $target, $width, $height);
@mkdir(dirname($target), 0777, TRUE);
$backend($source, $target, $width, $height);
+ return $target;
}
function mkthumb_exec($source, $target, $width, $height)
}
function mkthumb_exec($source, $target, $width, $height)