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
committerGeorg Ehrke <developer@georgehrke.com>2014-11-23 23:43:21 +0300
commit4c5aa43079a48523208c1a31b8155a03efef732a (patch)
tree30631d2a5d957b08b1ae342fe6444ecacd07f99d /lib/private/preview.php
parent3ff1f879e014c6be738b85fc7b9de6ca154520cc (diff)
add y to with-aspect naming schema
Diffstat (limited to 'lib/private/preview.php')
-rw-r--r--lib/private/preview.php20
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 . '/';
+ }
}