diff options
author | Georg Ehrke <developer@georgehrke.com> | 2014-08-26 16:43:08 +0200 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2014-11-23 21:43:21 +0100 |
commit | 4c5aa43079a48523208c1a31b8155a03efef732a (patch) | |
tree | 30631d2a5d957b08b1ae342fe6444ecacd07f99d | |
parent | 3ff1f879e014c6be738b85fc7b9de6ca154520cc (diff) | |
download | nextcloud-server-4c5aa43079a48523208c1a31b8155a03efef732a.tar.gz nextcloud-server-4c5aa43079a48523208c1a31b8155a03efef732a.zip |
add y to with-aspect naming schema
-rw-r--r-- | lib/private/preview.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/private/preview.php b/lib/private/preview.php index ee4507867c1..cae210a39ec 100644 --- a/lib/private/preview.php +++ b/lib/private/preview.php @@ -320,7 +320,7 @@ class Preview { if($fileInfo !== null && $fileInfo !== false) { $fileId = $fileInfo->getId(); - $previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/'; + $previewPath = $this->getPreviewPath($fileId); $this->userView->deleteAll($previewPath); return $this->userView->rmdir($previewPath); } @@ -390,7 +390,7 @@ class Preview { return array(); } - $previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/'; + $previewPath = $this->getPreviewPath($fileId); $wantedAspectRatio = (float) ($this->getMaxX() / $this->getMaxY()); @@ -504,7 +504,7 @@ class Preview { $this->preview = $preview; $this->resizeAndCrop(); - $previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/'; + $previewPath = $this->getPreviewPath($fileId); $cachePath = $this->buildCachePath($fileId); if ($this->userView->is_dir($this->getThumbnailsFolder() . '/') === false) { @@ -802,12 +802,18 @@ class Preview { $maxX = $this->getMaxX(); $maxY = $this->getMaxY(); - $previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/'; - $preview = $previewPath . $maxX . '-' . $maxY . '.png'; + $previewPath = $this->getPreviewPath($fileId); + $preview = $previewPath . strval($maxX) . '-' . strval($maxY); if ($this->keepAspect) { - $preview = $previewPath . $maxX . '-with-aspect.png'; - return $preview; + $preview .= '-with-aspect'; } + $preview .= '.png'; + return $preview; } + + + private function getPreviewPath($fileId) { + return $this->getThumbnailsFolder() . '/' . $fileId . '/'; + } } |