Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2014-08-26 18:43:08 +0400
committerMorris Jobke <hey@morrisjobke.de>2014-09-15 17:10:03 +0400
commit3157d307f7b05a31505a180b5e44e61ca03ec991 (patch)
tree570144b9e2350506edacc190705b65f5ab99ca7f
parent5357c91520da564df72f76dc510a04c37ded3fc2 (diff)
add y to with-aspect naming schema
-rwxr-xr-xlib/private/preview.php20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/private/preview.php b/lib/private/preview.php
index 086d9c0272a..ba2cbd33bf3 100755
--- a/lib/private/preview.php
+++ b/lib/private/preview.php
@@ -322,7 +322,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);
}
@@ -392,7 +392,7 @@ class Preview {
return array();
}
- $previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/';
+ $previewPath = $this->getPreviewPath($fileId);
$wantedAspectRatio = (float) ($this->getMaxX() / $this->getMaxY());
@@ -509,7 +509,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) {
@@ -797,12 +797,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 . '/';
+ }
}