diff --git a/src/_h5ai/php/inc/H5ai.php b/src/_h5ai/php/inc/H5ai.php index 4cb2b8c2..b0029ebd 100644 --- a/src/_h5ai/php/inc/H5ai.php +++ b/src/_h5ai/php/inc/H5ai.php @@ -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; diff --git a/src/_h5ai/php/inc/Thumb.php b/src/_h5ai/php/inc/Thumb.php index 173df884..cbaf01e4 100644 --- a/src/_h5ai/php/inc/Thumb.php +++ b/src/_h5ai/php/inc/Thumb.php @@ -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();