]> source.dussan.org Git - nextcloud-server.git/commitdiff
add y to with-aspect naming schema
authorGeorg Ehrke <developer@georgehrke.com>
Tue, 26 Aug 2014 14:43:08 +0000 (16:43 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Mon, 15 Sep 2014 13:10:03 +0000 (15:10 +0200)
lib/private/preview.php

index 086d9c0272a2e7c8c9581b1b62c62be99fedec5a..ba2cbd33bf39e60ee4a6bd1f51b7ab01d0648a7a 100755 (executable)
@@ -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 . '/';
+       }
 }