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:
authorRobin Appelman <icewind@owncloud.com>2015-07-17 15:44:24 +0300
committerRobin Appelman <icewind@owncloud.com>2015-10-01 14:14:47 +0300
commitdc49e767472ef67bcfd6318133537bef03ce7a7c (patch)
treeb36d046c6759b775e0b891c797152fa9cdf0f63d /lib/private/preview.php
parent884e2fcd6ecd9a402619fced47b8b5c9a63a85dd (diff)
stricter check if thumbnail is cached
Diffstat (limited to 'lib/private/preview.php')
-rw-r--r--lib/private/preview.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/private/preview.php b/lib/private/preview.php
index 41fc29e045f..24a9082b176 100644
--- a/lib/private/preview.php
+++ b/lib/private/preview.php
@@ -479,7 +479,7 @@ class Preview {
$preview = $this->buildCachePath($fileId, $previewWidth, $previewHeight);
// This checks if we have a preview of those exact dimensions in the cache
- if ($this->thumbnailSizeExists($allThumbnails, $previewWidth, $previewHeight)) {
+ if ($this->thumbnailSizeExists($allThumbnails, basename($preview))) {
return $preview;
}
@@ -528,16 +528,13 @@ class Preview {
* Check if a specific thumbnail size is cached
*
* @param FileInfo[] $allThumbnails the list of all our cached thumbnails
- * @param int $width
- * @param int $height
+ * @param string $name
* @return bool
*/
- private function thumbnailSizeExists($allThumbnails, $width, $height) {
+ private function thumbnailSizeExists($allThumbnails, $name) {
foreach ($allThumbnails as $thumbnail) {
- $name = $thumbnail['name'];
- list($cachedWidth, $cachedHeight) = $this->getDimensionsFromFilename($name);
- if ($cachedWidth === $width && $cachedHeight === $height) {
+ if ($name === $thumbnail->getName()) {
return true;
}
}