summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-09-30 14:07:59 +0200
committerRobin Appelman <icewind@owncloud.com>2015-09-30 15:18:02 +0200
commit96b812bee6884f29b32d678b10cca7737a781b78 (patch)
treee31d3b25a1c46921c221aea1079b93b5eb04cd38 /lib
parent4c912e66db3f60acc2234e9811a4d5f37810a0c8 (diff)
downloadnextcloud-server-96b812bee6884f29b32d678b10cca7737a781b78.tar.gz
nextcloud-server-96b812bee6884f29b32d678b10cca7737a781b78.zip
Clean temp files used for thumbnail generation
Diffstat (limited to 'lib')
-rw-r--r--lib/private/preview/image.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/preview/image.php b/lib/private/preview/image.php
index e8473ebb8a4..2e46e19d706 100644
--- a/lib/private/preview/image.php
+++ b/lib/private/preview/image.php
@@ -35,12 +35,16 @@ class Image extends Provider {
$image = new \OC_Image();
- if($fileInfo['encrypted'] === true) {
+ $useTempFile = $fileInfo->isEncrypted() || !$fileInfo->getStorage()->isLocal();
+ if ($useTempFile) {
$fileName = $fileview->toTmpFile($path);
} else {
$fileName = $fileview->getLocalFile($path);
}
$image->loadFromFile($fileName);
+ if ($useTempFile) {
+ unlink($fileName);
+ }
$image->fixOrientation();
return $image->valid() ? $image : false;