mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-30 23:15:14 -04:00
Cleans and improves PHP code.
This commit is contained in:
parent
c6a9374488
commit
42cfe55ef3
10 changed files with 115 additions and 156 deletions
|
@ -27,7 +27,7 @@ class Thumb {
|
|||
|
||||
public function thumb($type, $sourceAbsHref, $mode, $width, $height) {
|
||||
|
||||
$sourceAbsPath = $this->h5ai->getAbsPath($sourceAbsHref);
|
||||
$sourceAbsPath = $this->h5ai->get_abs_path($sourceAbsHref);
|
||||
|
||||
if ($type === "img") {
|
||||
$captureAbsPath = $sourceAbsPath;
|
||||
|
@ -48,8 +48,8 @@ class Thumb {
|
|||
}
|
||||
|
||||
$name = "thumb-" . sha1("$sourceAbsPath-$width-$height-$mode") . ".jpg";
|
||||
$thumbAbsPath = $this->h5ai->getCacheAbsPath() . "/" . $name;
|
||||
$thumbAbsHref = $this->h5ai->getCacheAbsHref() . $name;
|
||||
$thumbAbsPath = $this->h5ai->get_cache_abs_path() . "/" . $name;
|
||||
$thumbAbsHref = $this->h5ai->get_cache_abs_href() . $name;
|
||||
|
||||
if (!file_exists($thumbAbsPath) || filemtime($sourceAbsPath) >= filemtime($thumbAbsPath)) {
|
||||
$image = new Image();
|
||||
|
@ -68,7 +68,7 @@ class Thumb {
|
|||
return null;
|
||||
}
|
||||
|
||||
$captureAbsPath = $this->h5ai->getCacheAbsPath() . "/capture-" . sha1($sourceAbsPath) . ".jpg";
|
||||
$captureAbsPath = $this->h5ai->get_cache_abs_path() . "/capture-" . sha1($sourceAbsPath) . ".jpg";
|
||||
|
||||
if (!file_exists($captureAbsPath) || filemtime($sourceAbsPath) >= filemtime($captureAbsPath)) {
|
||||
$cmd = str_replace("[SOURCE]", $sourceAbsPath, $cmd);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue