summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-09-16 08:36:33 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-09-16 08:36:33 +0200
commitaf52ffc5d56ef10d39446414cdd62647eaf56868 (patch)
treecf81a5b909a7fa06ce87b78abe6ecc3441f610a0
parent245a0e2ad8256b20cf4edaedaa0c1df53b662293 (diff)
parentcf76933b7642d4c429e78fc9cdc99e82872ba0f2 (diff)
downloadnextcloud-server-af52ffc5d56ef10d39446414cdd62647eaf56868.tar.gz
nextcloud-server-af52ffc5d56ef10d39446414cdd62647eaf56868.zip
Merge pull request #10639 from owncloud/fix_naming_schema_preview_with_aspect
add y to with-aspect naming schema
-rwxr-xr-xlib/private/preview.php24
1 files changed, 17 insertions, 7 deletions
diff --git a/lib/private/preview.php b/lib/private/preview.php
index 086d9c0272a..d6bff961a73 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,22 @@ 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;
}
+
+
+ /**
+ * @param int $fileId
+ * @return string
+ */
+ private function getPreviewPath($fileId) {
+ return $this->getThumbnailsFolder() . '/' . $fileId . '/';
+ }
}