mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-03-19 12:00:01 +01:00
Updates Thumb to use defined paths.
This commit is contained in:
parent
09abaa9a3c
commit
1458623998
@ -86,19 +86,6 @@ class H5ai {
|
||||
}
|
||||
|
||||
|
||||
public function getCacheAbsPath() {
|
||||
|
||||
return $this->h5aiAbsPath . '/cache';
|
||||
}
|
||||
|
||||
|
||||
public function getTempAbsPath() {
|
||||
|
||||
// return H5ai::normalize_path(sys_get_temp_dir());
|
||||
return $this->h5aiAbsPath . '/cache';
|
||||
}
|
||||
|
||||
|
||||
public function getRootAbsHref() {
|
||||
|
||||
return $this->rootAbsHref;
|
||||
@ -111,6 +98,25 @@ class H5ai {
|
||||
}
|
||||
|
||||
|
||||
public function getCacheAbsPath() {
|
||||
|
||||
return $this->h5aiAbsPath . '/cache';
|
||||
}
|
||||
|
||||
|
||||
public function getCacheAbsHref() {
|
||||
|
||||
return $this->h5aiAbsHref . 'cache/';
|
||||
}
|
||||
|
||||
|
||||
public function getTempAbsPath() {
|
||||
|
||||
// return H5ai::normalize_path(sys_get_temp_dir());
|
||||
return $this->h5aiAbsPath . '/cache';
|
||||
}
|
||||
|
||||
|
||||
public function getOptions() {
|
||||
|
||||
return $this->options;
|
||||
|
@ -47,10 +47,10 @@ class Thumb {
|
||||
return null;
|
||||
}
|
||||
|
||||
$name = "cache/thumb-" . sha1("$sourceAbsPath-$width-$height-$mode") . ".jpg";
|
||||
// $name = "cache/thumb-" . sha1("$sourceAbsPath-$width-$height-$mode") . ".png";
|
||||
$thumbAbsHref = $this->h5ai->getH5aiAbsHref() . $name;
|
||||
$thumbAbsPath = $this->h5ai->getH5aiAbsPath() . "/" . $name;
|
||||
$name = "thumb-" . sha1("$sourceAbsPath-$width-$height-$mode") . ".jpg";
|
||||
// $name = "thumb-" . sha1("$sourceAbsPath-$width-$height-$mode") . ".png";
|
||||
$thumbAbsPath = $this->h5ai->getCacheAbsPath() . "/" . $name;
|
||||
$thumbAbsHref = $this->h5ai->getCacheAbsHref() . $name;
|
||||
|
||||
if (!file_exists($thumbAbsPath) || filemtime($sourceAbsPath) >= filemtime($thumbAbsPath)) {
|
||||
$image = new Image();
|
||||
|
Loading…
x
Reference in New Issue
Block a user